Microsoft KB Archive/68055

CURRENT-DATE “Operand Is Not Declared” Without OSVS Directive

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

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

Summary: Use of the reserved word CURRENT-DATE results in the compiler syntax checking error “0012-S Operand is not Declared” using COBOL version 3.0, 3.0a, or 4.0, unless the compiler directive OSVS is used. CURRENT-DATE is a reserved word only in OSVS COBOL. An alternative way of obtaining the system date is: 01 ws-date pic x(6). . . . ACCEPT ws-date FROM DATE

More Information: CURRENT-DATE is a reserved word only for OSVS COBOL. Using the compiler directive OSVS with a program causes the data item CURRENT-DATE to contain the system date in the format MM/DD/YY. The system date obtained using the ACCEPT FROM DATE clause is in the format YYMMDD. Use of the compiler directive CURRENT-DATE“DDMMYY” causes the system date to use that format. Further information on this compiler directive can be found on page 3-30 of “Microsoft COBOL 4.0: Operating Guide.” For further information on this subject, query on the following words: COBOL and current and system and date and display

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