The TIME function enables the application program to obtain information about timing intervals in one of three precision levels:
Timer units
Binary
Decimal
If time is requested in timer units, an unsigned fullword containing the number of timer units elapsed since midnight is returned to the application program. A timer unit is defined as 26.04166 microseconds.
If time is requested in binary, a positive fullword containing the number of hundredths of seconds since midnight is returned to the application program.
If time is requested in decimal, a signed fullword of the format X'hhmmssth' is returned to the application program (hours, minutes, seconds, and tenths of seconds since midnight).
The time can also be obtained by using the standard COBOL reserved word TIME-OF-DAY or the standard PL/I functions.
- Format
The format for using the TIME function is:
TIME (retcode,area,code)
retcode Required.
A fullword where Com-plete places the return code upon completion of the operation.area Required.
A fullword area in the working storage area of the application program where the time returned.code Required.
A binary halfword containing the code that specifies the type of time being requested. Permissible values for the code are 0, 1, or 2.0 indicates timer units. 1 indicates binary units. 2 indicates decimal units. - Return Codes
A return code of 0 is issued upon normal completion of the TIME function.
- Abends
An abnormal termination may occur during execution of the TIME function. Possible causes include:
An invalid area argument was specified;
An invalid code argument was specified;
The area argument field is not on a fullword boundary.