Microsoft KB Archive/35268

&quot;_MSUPCASE&quot; in COBOL 3.0 Does Not Set the Status Variable

PSS ID Number: Q35268 Article last modified on 04-21-1993

3.00 3.00a | 3.00 3.00a MS-DOS | OS/2

Summary: In COBOL version 2.2, the “UPCASE” extension subroutine returns a status code of 00 if the subroutine is able to run correctly. If the length specified is larger than the data-name length, the UPCASE subroutine returns a 30 status code. However in COBOL version 3.0 or 3.0a, even if an incorrect length is given, the subroutine runs and returns a 00 status code. Microsoft has confirmed this to be a problem in Microsoft COBOL Compiler versions 3.0 and 3.0a. This problem was corrected in Microsoft COBOL Professional Development System version 4.0 for MS-DOS and MS OS/2.

More Information: The following code example demonstrates the problem: IDENTIFICATION DIVISION. PROGRAM-ID. CALLTEST. ENVIRONMENT DIVISION. DATA DIVISION. working-storage section. 01 size-of pic 99 value 30. 01 up-status pic x(2). 01 part-num pic x(6). PROCEDURE DIVISION. main-para. move “99” to up-status. move “abcdee” to part-num. display part-num. display up-status. * call “UPCASE” using part-num, size-of, up-status. *Switch these two call statements to run under COBOL 2.2. call &quot;_msUPCASE&quot; using by reference part-num, by content length of part-num size-of, length of size-of by reference up-status. display part-num. display up-status. stop run. The following is the output:

Additional reference words: 3.00 3.00a Copyright Microsoft Corporation 1993.