Microsoft KB Archive/38496

COBOL 2.2 ACCEPT FROM TIME Doesn’t Return Fractional Seconds

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

2.20 MS-DOS

Summary: When you compile the program below in Microsoft COBOL Version 2.2, the ACCEPT FROM TIME statement always returns “00” in the fractional seconds. The ACCEPT FROM TIME statement returns the proper fractional value in Microsoft COBOL Version 3.0. Microsoft has confirmed this to be a problem in Version 2.2. This problem was corrected in Version 3.0.

More Information: The following is a code example: IDENTIFICATION DIVISION. PROGRAM-ID. TIMETEST. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-TIME. 05 HRS PIC XX. 05 MIN PIC XX. 05 SEC PIC XX. 05 FRC PIC XX. PROCEDURE DIVISION. MAIN-PROGRAM. ACCEPT WS-TIME FROM TIME. DISPLAY WS-TIME. STOP RUN.

Additional reference words: 2.20 Copyright Microsoft Corporation 1993.