3gm is right, but so is Dan01.
HP has Special Register Word called WHEN-COMPILED and a ANSI function called WHEN-COMPILED.
Here is the definition of Special Register Word:
"A special register is a storage area in main memory that contains information primarily used in connection with specific COBOL features. The content of this area is generated automatically by the compiler. In a COBOL program, such an area is referenced by a special register word."
The Special Register Word WHEN-COMPILED is not part of ANSI COBOL, just as Dan01 says.
But the function WHEN-COMPILED is ANSI COBOL, just as 3gm says.
This references the register:
MOVE WHEN-COMPILED TO ws-field
This references the function:
MOVE FUNCTION WHEN-COMPILED TO ws-field
The results could be different though, because the register reference obtains the date and time from the software clock. But, the function retrieves it from the hardware clock.
Dimandja