Microsoft KB Archive/59763

FLAG(ANS85) Directive Incorrectly Flags Some Statements

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

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

Summary: In the program below, the FLAG(ANS85) compiler directive causes the compiler to incorrectly flag a line as not being ANSI 85 compatible. Microsoft has confirmed this to be a problem in COBOL versions 3.0 and 3.0a for MS-DOS and MS OS/2. This problem has been corrected in Microsoft COBOL Professional Development System version 4.0 for MS-DOS and MS OS/2.

More Information: The program below, ANSFLAG.COB, uses the directive FLAG(ANS85) to flag syntax that is not part of ANSI 85. COBOL versions 3.0 and 3.0a incorrectly flag the following line: 03 ERROR-MSG-LINE If PROBLEM-LINE is changed so that there is no VALUE SPACES, it compiles correctly. If the definition for ERROR-MSG is moved above PROBLEM-LINE, it also compiles correctly. Compile ANSFLAG.COB as follows: COBOL ANSFLAG ;

Code Example
$SET FLAG(ANS85) IDENTIFICATION DIVISION. PROGRAM-ID. TEST-PROGRAM. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01  PROBLEM-LINE             VALUE SPACES. 03 WHEN-VALUE-SPACES    PIC 9(4). 01  TEMP-VALUE               PIC 9(4). 01  ERROR-MSG. 03 ERROR-MSG-LINE       OCCURS 1 TO 72 DEPENDING ON TEMP-VALUE INDEXED BY EMB PIC X(1). PROCEDURE DIVISION. STOP-RUN. When compiled, the following error message is produced: 23 03 ERROR-MSG-LINE OCCURS 1 TO 72 543-MF ————————————-  VALUE clause on variable length group * Checking complete with no errors - starting code generation * Data = 000000804 Code = 000000274 Dictionary = 000000686

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