In CICS, ASKTIME and FORMATTIME are two popular built-in macros in CICS.

1. How to Use ASKTIME
ASK TIME
When you use ‘ASKTIME, it populates the default time, which set by your workshop admin. So to get local time, always use FORMATTIME convert it to local format.
2. How to Rest TIME
Below is the command to reset the time. It is usually perform by CICS admins.
CEMT PERFORM RESET
Then, it syncs to local time
3. How to Use EIBDATE and EIBTIME
Saying that ASKTIME and FORMATTIME are two available options to get TIME and to format it. However, you can find Time in EIBDATE and EIBTIME fields. These are Exec Interface Block times.
4. The Purpose of ASKTIME
The purpose of ASKTIME is to get timestamp for logging purpose.
Sample Program to Use FORMATTIME and ASKTIME
CICS Date/Time Functions
WORKING-STORAGE SECTION.
01 WS-TIME PIC S9(15) COMP-3 VALUE 0.
01 PRINT-DATE PIC X(08) VALUE ‘12/01/99’.
01 PRINT-TIME PIC X(08) VALUE ‘09:30:00’.
…
PROCEDURE DIVISION.
…
EXEC CICS
ASKTIME ABSTIME(WS-TIME)
END-EXEC
…
EXEC CICS
FORMATTIME ABSTIME(WS-TIME)
MMDDYY(PRINT-DATE)
DATESEP(‘/’)
END-EXEC
…
EXEC CICS
FORMATTIME ABSTIME(WS-TIME)
TIME(PRINT-TIME)
TIMESEP(‘:’)
END-EXEC
********** Other Formats Available (There are more!) **************
EXEC CICS
FORMATTIME ABSTIME(WS-TIME)
YYDDD(DATA-AREA) YY/DDD
YYMMDD(DATA-AREA) YY/MM/DD
DATESEP(‘-‘) YY-MM-DD ]
* Following 4 receiving fields are defined as: PIC S9(08) COMP.
DAYOFWEEK(DATA-AREA) Sun=0, Mon=1,…
DAYOFMONTH(DATA-AREA)
MONTHOFYEAR(DATA-AREA) Jan=1, Feb=2,…
YEAR(DATA-AREA) 4 DIGIT YEAR!!
END-EXEC
Related Posts
You must be logged in to post a comment.