IBM Extension

WHEN-COMPILED Special Register

This special register contains the date at the start of compilation. It consists of an alphanumeric data item with the implicit definition:
01     WHEN-COMPILED GLOBAL PICTURE X(16) USAGE DISPLAY
and format:
MM/DD/YYhh.mm.ss (MONTH/DAY/YEARhour.minute.second)

For example, if compilation began at 2:04 PM on 15 December 1994, WHEN-COMPILED would contain the value 12/15/9414.04.00.

The DATSEP or TIMSEP parameter of job-related commands (such as CHGJOB) specifies the date-separation or time-separation character used in the WHEN-COMPILED special register. The DATFMT parameter specifies the date format used in the WHEN-COMPILED special register.

It is valid only as the sending item in a MOVE statement.

The special register data can be reference-modified only when it is used as a sender data item.

In nested programs, this special register is implicitly defined in the outermost program.
Note: The compilation date and time is also accessible using the date and time intrinsic function WHEN-COMPILED (see WHEN-COMPILED). That function supports 4-digit year values, and provides additional information.
End of IBM Extension