CICS – DATE And TIME Command

When you are working on CICS, we need to obtain Date and Time from CICS terminals. When a task is started, CICS will store these values in exec interface block fields like EIBDATE and EIBTIME.

When a task is started these fields will be updated with TIME and date.

Also Read | How to modify VSAM file length in CICS

There is a way how to extract Date and Time from CICS.

The ASKTIME command will update DATE and TIME into EIBDATE and EIBTIME fields. Later we need to use FORMATTIME command to get Date and Time in format whatever way we want.

EXEC CICS
 ASKTIME [ ABSTIME(data-area) ]
 END-EXEC

ABSTIME command places DATE and TIME fields into local area.

Also Read | The best way to handle file sharing in CICS

How to get DAY-OF-WEEK using below code?

This example shows how to obtain an absolute time and, using a FORMATTIME command, get the current day-of-week. ABSOLUTE-TIME is a 15-digit packed-decimal field (PIC S9(15) COMP-3), and DAY-OF-WEEK is a binary fullword (PIC S9(8) COMP).

0500-GET-DAY-OF-WEEK.
 *
 EXEC CICS
 ASKTIME ABSTIME(ABSOLUTE-TIME)
 END-EXEC.
 EXEC CICS
 FORMATTIME ABSTIME(ABSOLUTE-TIME)
 DAYOFWEEK(DAY-OF-WEEK)
 END-EXEC.

 

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.