TSO-ISPF JCL COBOL VSAM DB2 CICS Tools Articles Job Portal Forum Quiz Interview Q&A

COBOL - WHEN-COMPILED Statement


The WHEN-COMPILED special register contains the date at the start of the compilation.

WHEN-COMPILED is an alphanumeric data item that has the implicit definition.

01  WHEN-COMPILED GLOBAL PICTURE X(16) USAGE DISPLAY.

The WHEN-COMPILED special register has the format.

MM/DD/YYhh.mm.ss (MONTH/DAY/YEARhour.minute.second)

For example, if compilation began at 2:04 PM on 15 October 2007, WHEN-COMPILED would contain the value 10/15/0714.04.00.

Tips:

  1. WHEN-COMPILED can be used only as the sending field in a MOVE statement.

  2. WHEN-COMPILED special register data cannot be reference-modified.

The compilation date and time can also be accessed with the intrinsic function WHEN-COMPILED. That function supports four-digit year values and provides additional information.

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 function type is alphanumeric.

FUNCTION WHEN-COMPILED

The returned value is the date and time of compilation of the source program that contains this function.


If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal