CEELOCT returns the current local date or time as a Lilian date (the number of days since 14 October 1582), as Lilian seconds (the number of seconds since 00:00:00 14 October 1582), and as a Gregorian character string (YYYYMMDDHHMISS999).
These values are compatible with other date and time callable services and with existing intrinsic functions.
CEELOCT performs the same function as calling the CEEGMT, CEEGMTO, and CEEDATM services separately. Calling CEELOCT, however, is much faster.
| CALL CEELOCT syntax |
|---|
|
If the local time is not available from the system, output_Lilian is set to 0 and CEELOCT terminates with a non-CEE000 symbolic feedback code.
If the local time is not available from the system, output_seconds is set to 0 and CEELOCT terminates with a non-CEE000 symbolic feedback code.
If the format of output_Gregorian does not meet your needs, you can use the CEEDATM callable service to convert output_seconds to another format.
| Symbolic feedback code | Severity | Message number | Message text |
|---|---|---|---|
| CEE000 | 0 | — | The service completed successfully. |
| CEE2F3 | 3 | 2531 | The local time was not available from the system. |
Usage notes
CBL LIB
************************************************
** **
** Function: Call CEELOCT to get current **
** local time **
** **
** In this example, a call is made to CEELOCT **
** to return the current local time in Lilian **
** days (the number of days since 14 October **
** 1582), Lilian seconds (the number of **
** seconds since 00:00:00 14 October 1582), **
** and a Gregorian string (in the form **
** YYYMMDDMISS999). The Gregorian character **
** string is then displayed. **
** **
************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. CBLLOCT.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 LILIAN PIC S9(9) BINARY.
01 SECONDS COMP-2.
01 GREGORN PIC X(17).
01 FC.
02 Condition-Token-Value.
COPY CEEIGZCT.
03 Case-1-Condition-ID.
04 Severity PIC S9(4) COMP.
04 Msg-No PIC S9(4) COMP.
03 Case-2-Condition-ID
REDEFINES Case-1-Condition-ID.
04 Class-Code PIC S9(4) COMP.
04 Cause-Code PIC S9(4) COMP.
03 Case-Sev-Ctl PIC X.
03 Facility-ID PIC XXX.
02 I-S-Info PIC S9(9) COMP.
PROCEDURE DIVISION.
PARA-CBLLOCT.
CALL 'CEELOCT' USING LILIAN, SECONDS,
GREGORN, FC.
************************************************
** If CEELOCT runs successfully, display **
** Gregorian character string **
************************************************
IF CEE000 of FC THEN
DISPLAY 'Local Time is ' GREGORN
ELSE
DISPLAY 'CEELOCT failed with msg '
Msg-No of FC UPON CONSOLE
STOP RUN
END-IF.
GOBACK.