CEEFMDT—Get default date and time format
CEEFMDT returns the default date and time picture strings for the country specified by country_code. CEEFMDT is affected only by the country code setting of the COUNTRY runtime option or CEE3CTY callable service, not the CEESETL callable service or the setlocale() function.
- country_code (input)
- A 2-character fixed-length string representing one of the country
codes found in Table 1. The country_code is
not case-sensitive. Also, if no value is specified, the default country
code (as set by either the COUNTRY runtime option or by CEE3CTY) is
used. If you specify a country_code that
is not valid, the default
date/time picture string is
'YYYY-MM-DD HH:MI:SS'. - datetime_str (output)
- A fixed-length 80-character string (VSTRING), returned to the calling routine. It contains the default date and time picture string for the country specified. The picture string is left-justified and padded on the right with blanks, if necessary.
- 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. CEE3CF 2 3471 The country code country_code was invalid for CEEFMDT. The default date and time picture string datetime_str was returned.
Usage notes
- z/OS UNIX considerations—CEEFMDT applies to the enclave. Every enclave has a single current country setting that has a single date and time format. Every thread in every enclave has the same default.
For more information
- For a list of the default settings for a specified country, see Table 1.
- See COUNTRY for an explanation of the COUNTRY runtime option.
- See CEE3CTY—Set the default country for an explanation of CEE3CTY.
Examples
- Following is an example of CEEFMDT called by C/C++.
/*Module/File Name: EDCFMDT */ #include <stdio.h> #include <string.h> #include <leawi.h> #include <stdlib.h> #include <ceeedcct.h> int main(void) { _FEEDBACK fc; _CHAR2 country; _CHAR80 date_pic; /* get the default date and time format for Canada */ memcpy(country,"CA",2); CEEFMDT(country,date_pic,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEFMDT failed with message number %d\n", fc.tok_msgno); exit(2999); } /* print out the default date and time format */ printf("%.80s\n",date_pic); } - Following is an example of CEEFMDT called by COBOL.
CBL LIB,QUOTE *Module/File Name: IGZTFMDT ************************************************* ** ** ** CBLFMDT - Call CEEFMDT to obtain the ** ** default date & time format ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLFMDT. DATA DIVISION. WORKING-STORAGE SECTION. 01 COUNTRY PIC X(2). 01 PICSTR PIC X(80). 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-CBLFMDT. ** Specify country code for the US MOVE "US" TO COUNTRY. ** Call CEEFMDT to return the default date and ** time format for the US CALL "CEEFMDT" USING COUNTRY , PICSTR , FC. ** If CEEFMDT runs successfully, display result. IF CEE000 of FC THEN DISPLAY "The default date and time " "format for the US is: " PICSTR ELSE DISPLAY "CEEFMDT failed with msg " Msg-No of FC UPON CONSOLE STOP RUN END-IF. GOBACK. - Following is an example of CEEFMDT called by PL/I.
*PROCESS MACRO; /* Module/File Name: IBMFMDT */ /****************************************************/ /** **/ /** Function: CEEFMDT - obtain default **/ /** date & time format **/ /** **/ /****************************************************/ PLIFMDT: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL COUNTRY CHARACTER ( 2 ); DCL PICSTR CHAR(80); 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); COUNTRY = 'US'; /* Specify country code for */ /* the United States */ /* Call CEEFMDT to get default date format */ /* for the US */ CALL CEEFMDT ( COUNTRY , PICSTR , FC ); /* Print default date format for the US */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The default date and time ' || 'format for the US is ' || PICSTR ); END; ELSE DO; DISPLAY( 'CEEFMDT failed with msg ' || FC.MsgNo ); STOP; END; END PLIFMDT;
