The GET TIME statement obtains the time of day and date from the operating system. The system time is returned to the issuing task in either fixed binary, packed decimal, or edited format. The date is returned to the program in packed decimal format.
►►─── GET TIME ─┬─────────────────────────────────────┬───────────────────────► └─┬────────────┬─ INTO (return-time) ─┘ ├─ BINARY ◄ ─┤ ├─ DECIMAL ──┤ └─ EDIT ─────┘ ►─┬───────────────────────────┬─ ; ──────────────────────────────────────────►◄ └─ DATE INTO (return-date) ─┘
Specifies the format in which the time is to be returned to the issuing program. The requested formats can be fixed binary, decimal, or edited. In all cases, the returned value indicates the time since midnight:
Returns the time in pure (absolute) binary format representing the elapsed time since midnight in ten-thousandths of a second. If BINARY is specified, the field associated with return-time must be a fixed binary field capable of holding a number at least as large as the number of ten-thousandths seconds in a day (864,000,000). This option provides the finest resolution of time available. BINARY is the default.
Returns the time in the format ohhmmssttttc (padded zero, hours, minutes, seconds, ten-thousandths of a second, and sign). If DECIMAL is specified, the field associated with return-time should be declared as FIXED DECIMAL(11).
Returns the time as an edited character string in the format hh:mm:ss:hh (hours, minutes, seconds, hundredths of a second). The field size and type associated with return-time should be defined as CHAR(11).
Specifies the field to which the system will return the time. Return-time is the symbolic name of a user-defined field to which the current time will be returned. The required field size and type depend on the requested format, as described above.
Specifies the field to which the system will return the date obtained from the operating system. Return-date is the symbolic name of the user-defined field to which the Julian date is returned. The Julian date is returned in FIXED DECIMAL(7) format: 0yyydddc (padded zero, current year relative to 1900, date, and sign). For example, 0099365C would represent December 31, 1999. 0100001C would represent January 1, 2000.
The following statement returns the current time and date to the CURRENT_TIME and CURRENT_DATE fields, respectively:
GET TIME EDIT INTO (CURRENT_TIME) DATE INTO (CURRENT_DATE);
Upon completion of the GET TIME function, the only possible value in the ERROR_STATUS field of the IDMS DC communications block is 0000.
|
Copyright © 2014 CA.
All rights reserved.
|
|