Description

The TIME macro returns the local time of day and date, the Coordinated Universal Time (UTC) (or the Greenwich mean time) of day and date, or the contents of the time-of-day (TOD) clock. The time-of-day clock referenced can be either in the basic time-of-day format (TOD) or the extended time-of-day format (ETOD).

You can use the STCKCONV and CONVTOD macros to convert between TOD-clock format and various time of day and date formats. The STCKCONV macro converts a TOD-clock value to a time of day and date value and the CONVTOD macro converts a time of day and date value to a TOD clock value. See z/OS MVS Programming: Assembler Services Guide and z/Architecture® Principles of Operation for information comparing the formats of the TOD and ETOD.

In a system using an external time reference (ETR1), the TOD clocks are set automatically at system initialization. However, in a system without an ETR, the time of day and date are only as accurate as the information entered by the operator. System response time also influences the accuracy of the values returned by the TIME macro.

There are two different linkage methods that can be specified. The TIME macro with LINKAGE=SYSTEM can be used by a program in primary or AR mode, in cross memory mode, and in either an enabled or disabled state. The LINKAGE=SYSTEM parameter also permits a choice of formats for the date value returned, as well as list and execute forms of the macro. With LINKAGE=SVC, the caller cannot be in cross memory mode or AR mode, must be in an enabled state, and has no choice of the format for the returned date value.

IBM recommends the use of the LINKAGE=SYSTEM parameter on the TIME macro. The LINKAGE=SVC parameter is provided solely for compatibility with existing programs.

The following description of the TIME macro is divided into two sections, LINKAGE=SYSTEM and LINKAGE=SVC. There are list and execute forms of the macro for LINKAGE=SYSTEM, but not for LINKAGE=SVC.

1 External time reference (ETR) is the MVS™ generic name for the IBM® Sysplex Timer.