Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/35268

From BetaArchive Wiki

"_MSUPCASE" 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

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

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 "_msUPCASE" 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:

COBOL Version 2.2 COBOL Version 3.0
ab ab
99 99
ab AB
30 00

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