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/37408

From BetaArchive Wiki

SPECIAL-NAMES with CURSOR IS Fails in Nested Subprograms

PSS ID Number: Q37408 Article last modified on 04-20-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: When more than one nested subprogram tries to use SPECIAL-NAMES with the CURSOR IS or CRT STATUS IS phrase, the compiler issues an error message. The program example below demonstrates the problem. Microsoft has confirmed this to be a problem in the COBOL version 3.0 and 3.0a Compiler. This problem was corrected in Microsoft COBOL Professional Development System version 4.0 for MS-DOS and MS OS/2.

More Information: Note: Support for nested programs is an ANSI 85 standard, and therefore, is not supported in versions of the Microsoft COBOL Compiler earlier than version 3.0. The example code below will cause the following error message (during the compile phase): CRT-STATUS2 missing or illegal. The following is code example (all in one source file): $SET NESTCALL ANS85 IDENTIFICATION DIVISION. PROGRAM-ID. DRIVER. DATA DIVISION. PROCEDURE DIVISION. CALL “SUB1”. CALL “SUB2”. STOP RUN. IDENTIFICATION DIVISION. PROGRAM-ID. SUB1. ENVIRONMENT DIVISION. SPECIAL-NAMES. CONSOLE IS CRT CRT STATUS IS CRT-STATUS1. WORKING-STORAGE SECTION. 01 CRT-STATUS1. 03 FIRST-PART. 05 FIRST-BYTE PIC X. 05 SECOND-BYTE PIC 99 COMP. 03 FILLER PIC X. PROCEDURE DIVISION. DISPLAY “PASSED TO SUB1”. END PROGRAM SUB1. IDENTIFICATION DIVISION. PROGRAM-ID. SUB2. ENVIRONMENT DIVISION. SPECIAL-NAMES. CONSOLE IS CRT CRT STATUS IS CRT-STATUS2. WORKING-STORAGE SECTION. 01 CRT-STATUS2. 03 FIRST-PART. 05 FIRST-BYTE PIC X. 05 SECOND-BYTE PIC 99 COMP. 03 FILLER PIC X. PROCEDURE DIVISION. DISPLAY " AND THEN TO SUB2" END PROGRAM SUB2. END PROGRAM DRIVER.

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