Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

WHEN-COMPILED - Date and time of compilation

The WHEN-COMPILED function returns the date and time the program was compiled.
The type of this function is alphanumeric.

Format


FUNCTION WHEN-COMPILED


Returned value

  1. The character positions returned, numbered from left to right, are:

    Character positionContents
    1-4
    5-6
    7-8
    9-10
    11-12
    13-14
    15-21
    Four numeric digits of the year (Gregorian calendar).
    Two numeric digits of the month of the year, in the range 01 through 12.
    Two numeric digits of the day of the month, in the range 01 through 31.
    Two numeric digits of the hours past midnight, in the range 00 through 23.
    Two numeric digits of the minutes past the hour, in the range 00 through 59.
    Two numeric digits of the seconds past the minute, in the range 00 through 59.
    0000000


See also:
        CURRENT-DATE, DATE-OF-INTEGER, DAY-OF-INTEGER, INTEGER-OF-DATE, INTEGER-OF-DAY

Example 9-48

...
DATA DIVISION.
WORKING-STORAGE SECTION.
01  A-DATE PIC X(21).
PROCEDURE DIVISION.
P1 SECTION.
MAIN.
    MOVE FUNCTION WHEN-COMPILED TO A-DATE.
    DISPLAY A-DATE UPON T.
    STOP RUN.

Result:               199604211434270000000