WHEN-COMPILED Function

The WHEN-COMPILED function returns the date and time the program was compiled as provided by the system on which the program was compiled. The type of this function is alphanumeric.

Usage

FUNCTION WHEN-COMPILED

Returned Values

  1. The character positions returned, numbered from left to right, are described in the table below.
    Character Positions Contents
    1-4 Four numeric digits of the year in the Gregorian calendar.
    5-6 Two numeric digits of the month of the year, in the range 01 through 12.
    7-8 Two numeric digits of the day of the month, in the range 01 through 31.
    9-10 Two numeric digits of the hours past midnight, in the range of 00 through 23.
    11-12 Two numeric digits of the minutes past the hour, in the range 00 through 59.
    13-14 Two numeric digits of the seconds past the minute, in the range 00 through 59.
    15-16 Two numeric digits of the hundredths of a second past a second, in the range 00 through 99. The value 00 will be returned for all systems
    17 The character '0'. This field is reserved for future implementation.
    18-19 The characters '00'. This field is reserved for future implementation.
    20-21 The characters '00'. This field is reserved for future implementation.
  2. The returned value is the date and time of compilation of the source program that contains this function. If the program is a contained program, the returned value is the compilation date and time associated with the separately compiled program in which it is contained.
    Note: The returned value must denote the same time as the compilation date and time if provided in the listing of the source program and in the generated object code for the source program, although their representations and precisions may differ.
  3. The returned value can be reference modified. For example:
    MOVE FUNCTION WHEN-COMPILED (1:4) TO YEARDATE.