Microsoft KB Archive/37476

COBOL 3.0 Requires Special Definition for CRT STATUS

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

3.00 | 3.00 MS-DOS | OS/2

Summary: The code sample below shows the correct definition of the variable in working storage that holds the CRT STATUS. If the definition is altered so that CRT STATUS uses more or less than three bytes, the compiler generates a “CRT-STATUS missing or illegal” error message. Note: CRT-STATUS is not available in Microsoft COBOL versions earlier than Version 3.0. The following code shows the correct definition for CRT-STATUS:

$SET ANS85 SPECIAL-NAMES. CRT STATUS IS CRT-STATUS. WORKING-STORAGE SECTION. 01 CRT-STATUS. 05 FIRST-BYTE  PIC X.      05 SECOND-BYTE  PIC 99 COMP-X. 05 THIRD-BYTE  PIC 99 COMP-X. PROCEDURE DIVISION. STOP RUN. Additional reference words: 3.00 Copyright Microsoft Corporation 1993.