Microsoft KB Archive/35724
How to Invoke "_MSUPCASE" COBOL 3.0 Extension Subroutine
PSS ID Number: Q35724 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 "_MSUPCASE" replaces the extension “UPCASE” 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 uppercase. The syntax for this call given 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 ANS85.
More Information: In the program below, the grouping of characters to be converted to uppercase 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 a code example: DATA DIVISION. WORKING-STORAGE SECTION. 01 DATA-SIZE PIC 99 VALUE 23. 01 MY-STATUS PIC 9(2). 01 DATA-ITEM. 02 PART1 PIC X(10) VALUE “this is ch”. 02 PART2 PIC X(13) VALUE “anged to caps”. PROCEDURE DIVISION. MAIN. CALL "_MSUPCASE" USING BY REFERENCE DATA-ITEM, BY CONTENT LENGTH OF DATA-ITEM, DATA-SIZE, LENGTH OF DATA-SIZE, BY REFERENCE MY-STATUS. DISPLAY “In Caps” DATA-ITEM. STOP RUN.
Additional reference words: 3.00 Copyright Microsoft Corporation 1993.