CEESCEN—Set the century window

CEESCEN sets the century in which Language Environment contains the 2-digit year value. Use it in conjunction with CEEDAYS or CEESECS when:
  • You process date values containing 2-digit years (for example, in the YYMMDD format).
  • The Language Environment default century interval does not meet the requirements of a particular application.

Century intervals are kept as thread-level data, so changing the interval in one thread does not affect the interval in another thread. To query the century window, use CEEQCEN.

CEEQCEN affects and is affected by only the Language Environment NLS and date and time services, not the Language Environment locale callable services or the C locale-sensitive functions.
Read syntax diagramSkip visual syntax diagram
Syntax

>>-CEERAN0--(--century_start--,--fc--)-------------------------><

century_start
An integer between 0 and 100, setting the century window. A value of 80, for example, places all two-digit years within the 100-year window starting 80 years before the system date. In 1995, therefore, all two-digit years are assumed to represent dates between 1915 and 2014, inclusive.
fc (output)
A 12-byte feedback code, optional in some languages, that indicates the result of this service. If you choose to omit this parameter, refer to Invoking callable services for the appropriate syntax to indicate that the feedback code was omitted.

The following symbolic conditions can result from this service:

Code Severity Message number Message text
CEE000 0 The service completed successfully.
CEE2E6 3 2502 The UTC/GMT was not available from the system.

Usage notes

  • z/OS UNIX considerations—CEESCEN applies to the enclave. The century window applies to the enclave.

For more information

Examples

  1. Following is an example of CEESCEN called by C/C++.
    /*Module/File Name: EDCSCEN   */
    
    #include <string.h>
    #include <stdio.h>
    #include <leawi.h>
    #include <stdlib.h>
    #include <ceeedcct.h>
    
    int main (void) {
    
      _INT4 century_start;
      _FEEDBACK fc;
    
      century_start = 50;
    
      CEESCEN(&century_start,&fc);
      if ( _FBCHECK ( fc , CEE000 ) != 0 ) {
         printf("CEESCEN failed with message number %d\n",
                fc.tok_msgno);
         exit(2999);
      }
    }
  2. Following is an example of CEESCEN called by COBOL.
    CBL LIB,QUOTE
          *Module/File Name: IGZTSCEN
          **************************************************
          **                                              **
          ** CBLSCEN - Call CEESCEN to set the Lang. Env. **
          **           century window                     **
          **                                              **
          ** In this example, CEESCEN is called to change **
          ** the start of the century window to 30 years  **
          ** before the system date. CEEQCEN is then      **
          ** called to query that the change made.  A     **
          ** message that this has been done is then      **
          ** displayed.                                   **
          **                                              **
          **************************************************
           IDENTIFICATION DIVISION.
           PROGRAM-ID. CBLSCEN.
    
           DATA DIVISION.
           WORKING-STORAGE SECTION.
           01  STARTCW                 PIC S9(9) BINARY.
           01  FC.
               02  Condition-Token-Value.
               COPY  CEEIGZCT.
                   03  Case-1-Condition-ID.
                       04  Severity    PIC S9(4) BINARY.
                       04  Msg-No      PIC S9(4) BINARY.
                   03  Case-2-Condition-ID
                             REDEFINES Case-1-Condition-ID.
                       04  Class-Code  PIC S9(4) BINARY.
                       04  Cause-Code  PIC S9(4) BINARY.
                   03  Case-Sev-Ctl    PIC X.
                   03  Facility-ID     PIC XXX.
               02  I-S-Info            PIC S9(9) BINARY.
           PROCEDURE DIVISION.
           PARA-CBLSCEN.
          **************************************************
          ** Specify 30 as century start, and two-digit
          **     years will be assumed to lie in the
          **     100-year window starting 30 years before
          **     the system date.
          **************************************************
               MOVE 30 TO STARTCW.
    
          **************************************************
          ** Call CEESCEN to change the start of the century
          **     window.
          **************************************************
    
               CALL "CEESCEN" USING STARTCW, FC.
               IF NOT CEE000 of FC  THEN
                   DISPLAY "CEESCEN failed with msg "
                       Msg-No of FC UPON CONSOLE
                   STOP RUN
               END-IF.
          PARA-CBLQCEN.
          **************************************************
          ** Call CEEQCEN to return the start of the century
          **     window
          **************************************************
               CALL "CEEQCEN" USING STARTCW, FC.
    
          **************************************************
          ** CEEQCEN has no non-zero feedback codes to
          **     check, so just display result.
          **************************************************
                   DISPLAY "The start of the century "
                       "window is: " STARTCW
               GOBACK.
  3. Following is an example of CEESCEN called by PL/I.
    *PROCESS MACRO;
     /* Module/File Name: IBMSCEN                        */
     /****************************************************/
     /**                                                **/
     /** Function: CEESCEN - set the century window     **/
     /**                                                **/
     /****************************************************/
     PLISCEN: PROC OPTIONS(MAIN);
    
        %INCLUDE  CEEIBMAW;
        %INCLUDE  CEEIBMCT;
    
        DCL STARTCW  REAL FIXED BINARY(31,0);
        DCL 01 FC,                     /* Feedback token */
               03 MsgSev    REAL FIXED BINARY(15,0),
               03 MsgNo     REAL FIXED BINARY(15,0),
               03 Flags,
                  05 Case      BIT(2),
                  05 Severity  BIT(3),
                  05 Control   BIT(3),
               03 FacID     CHAR(3),      /* Facility ID */
               03 ISI   /* Instance-Specific Information */
                            REAL FIXED BINARY(31,0);
    
        STARTCW = 20; /* Set 20 as century start */
    
       /* Call CEESCEN to request that two-digit years   */
       /*    lie in the 100-year window starting 20      */
       /*    years before the system date                */
        CALL CEESCEN ( STARTCW, FC );
        IF  FBCHECK( FC, CEE000)  THEN  DO;
           PUT SKIP LIST ( 'The century window now starts '
              || STARTCW || ' years before today.');
           END;
        ELSE  DO;
           DISPLAY( 'CEESCEN failed with msg '
              || FC.MsgNo );
           STOP;
           END;
    
     END PLISCEN;