Microsoft KB Archive/35725

From BetaArchive Wiki

How to Invoke "_MSLOCASE" COBOL 3.0 Extension Subroutine

PSS ID Number: Q35725 Article last modified on 04-20-1993

3.00 | 3.00 MS-DOS | OS/2

The information in this article applies to:
- Microsoft COBOL for MS-DOS and OS/2, version 3.0

Summary: The Microsoft COBOL Version 3.0 extension subroutine "_MSLOCASE" replaces the extension “LOCASE” found in earlier Microsoft COBOL 2.x Versions. This extension subroutine may be called from a COBOL program to turn alphabetic characters within a data item into lower case. The syntax given for this call in the file MS2-2.DOC (found on the Setup disk) will cause the compiler to issue the following error message: Call parameter is literal (or LENGTH of) By content assumed Despite this warning message, the generated code may be used successfully. The sample program below works correctly and generates no error messages when compiled with the ANS85 directive.

More Information: In the program below, the grouping of characters to be converted to lowercase must be assigned to the variable name DATA-ITEM and the length of the number of characters to be converted must be assigned to the variable DATA-SIZE. The returned value in MY-STATUS will be “00” if it was successful or “30” if not. The following is code example: DATA DIVISION. WORKING-STORAGE SECTION. 01 DATA-SIZE PIC 99 VALUE 26. 01 MY-STATUS PIC 9(2). 01 DATA-ITEM. 02 PART1 PIC X(13) VALUE “THIS IS CHANG”. 02 PART2 PIC X(13) VALUE “ED TO LOWERS”. PROCEDURE DIVISION. MAIN. CALL "_MSLOCASE" USING BY REFERENCE DATA-ITEM, BY CONTENT LENGTH OF DATA-ITEM, DATA-SIZE, LENGTH OF DATA-SIZE, BY REFERENCE MY-STATUS. DISPLAY “In Lower case” DATA-ITEM. STOP RUN.

Additional reference words: 3.00 Copyright Microsoft Corporation 1993.