Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


CEELOCT—get current local date or time

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
Read syntax diagramSkip visual syntax diagram>>-CALL--"CEELOCT"--USING--output_Lilian,--output_seconds,------>
 
>--output_Gregorian,--fc.--------------------------------------><
 
output_Lilian (output)
A 32-bit binary integer that represents the current local date in the Lilian format, that is, day 1 equals 15 October 1582, day 148,887 equals 4 June 1990.

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.

output_seconds (output)
A 64-bit long floating-point number that represents the current local date and time as the number of seconds since 00:00:00 on 14 October 1582, not counting leap seconds. For example, 00:00:01 on 15 October 1582 is second number 86,401 (24*60*60 + 01). 19:00:01.078 on 4 June 1990 is second number 12,863,905,201.078.

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.

output_Gregorian (output)
A 17-byte fixed-length character string in the form YYYYMMDDHHMISS999 that represents local year, month, day, hour, minute, second, and millisecond.

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.

fc (output)
A 12-byte feedback code (optional) that indicates the result of this service.

Table 92. CEELOCT symbolic conditions
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

Example

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.

Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)