*PROCESS MACRO;
/*Module/File Name: IBMQDTC */
/****************************************************/
/* Example for callable service CEEQDTC */
/* Function: Retrieve date and time convention */
/* structures for two countries, compare an item. */
/****************************************************/
PLIQDTC: PROC OPTIONS(MAIN);
%INCLUDE CEEIBMAW; /* ENTRY defs, macro defs */
%INCLUDE CEEIBMCT; /* FBCHECK macro, FB constants */
%INCLUDE CEEIBMLC; /* Locale category constants */
%INCLUDE CEEIBMDT; /* DTCONV for CEEQDTC calls */
/* use explicit pointer to local DTCONV structure */
DCL LOCALDT POINTER INIT(ADDR(DTCONV));
/* CEESETL service call arguments */
DCL LOCALE_NAME CHAR(256) VARYING;
DCL 1 DTCONVC LIKE DTCONV; /* Def Second Structure */
DCL 1 FC, /* Feedback token */
3 MsgSev REAL FIXED BINARY(15,0),
3 MsgNo REAL FIXED BINARY(15,0),
3 Flags,
5 Case BIT(2),
5 Severity BIT(3),
5 Control BIT(3),
3 FacID CHAR(3), /* Facility ID */
3 ISI /* Instance-Specific Information */
REAL FIXED BINARY(31,0);
/* set locale with IBM default for France */
LOCALE_NAME = 'FFEY'; /* or Fr_FR.IBM-1047 */
/* use LC_ALL category constant from CEEIBMLC */
CALL CEESETL ( LOCALE_NAME, LC_ALL, FC );
/* retrieve date and time structure, France Locale*/
CALL CEEQDTC ( *, LOCALDT, FC );
/* set locale with French Canadian(FCEY) defaults */
/* literal constant -1 used to set all categories */
CALL CEESETL ( 'FCEY', -1, FC );
/* retrieve date and time tables for French Canada*/
/* example of temp pointer used for service call */
CALL CEEQDTC ( *, ADDR(DTCONVC), FC );
/* compare date and time formats for two countries*/
IF DTCONVC.D_T_FMT = DTCONV.D_T_FMT THEN
DO;
PUT SKIP LIST('Countries have same D_T_FMT' );
END;
ELSE
DO;
PUT SKIP LIST('Date and Time Format ',
DTCONVC.D_T_FMT||' vs '||
DTCONV.D_T_FMT );
END;
END PLIQDTC;