TIMEMCR START 0
BEGIN SAVE (14,12)
TIMEDAT DS CL16
SAVE DS 18F
But TIMESTAMP in TIMEDAT variable is in non-readable format.
Kindly guide me to make this TIME macro output in readable format.
Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
The date/time is in packed/unsigned (hex) format. Bytes 1-6 of "TIMEDAT" has a format of X'HHMMSSTHMIJU' and bytes 9-12 has a format of X'CCYYMMDD', which includes the correct century (CC), no added arithmetic necessary.
It's just a matter of converting these values into a readable-format, such as display-numeric. Here's a simple example -
If you intend on using this as a Called sub-program in CICS, the data-areas need to be reentrant (passed by the caller) and 'TIMEDAT' needs to be GETMAIN'd as 16-bytes of CICSKEY storage and FREEMAIN'd before returning to the caller. The GETMAIN'd CICSKEY storage is necessary, even if the PPT entry defines the program as CICSKEY, the allocated WS (DFHEISTG) runs in key 9 (USERKEY). CICSKEY is key 8. This version of the TIME Macro uses cross-memory transfers (PC/PT instructions) to a different address space and if STGPROT is active in the SIT (default is inactive) and 'TIMEDAT' is defined to USERKEY, a S0C4 will be raised as you've violated the Storage Protection rule. The default-standard version of the TIME Macro, expands into an SVC (11) and should NOT be used in CICS. Plus, the date returned (Julian) is in R1, with a format of PL4'0CYYDDD' (add 1900000 to make it Y2K compliant as the 0C will equal 01 since 1 January 2000) and the time-returned is in R0, with a format of XL4'HHMMSSTH'. Your CICS System Programmer needs to be consulted before implementation.
Thanks for the help. I'm able to use this Assembler routine from COBOL to get time stamp with microsecond precision. This is the highest precision for timestamp right? or any other method is available to get precision less than 1 micro second ?
In my COBOl application, i'm displaying this timestamp at the start and end of the program and now i want to do the same in CICS but faced the problem in LINKEDIT itself. 'Member could not be included from the designated call cibrary'
Used the call,
CALL 'TIMSTAMP' USING WS-PARM-FOR-ASM
like how i did for a COBOL program.
Not sure whether i can call ASSEMBLER module in this format in a COBOL-CICS program.
I didn't understand your explaination totally for accessing this assembler program as a called-program from a CICS-COBOL. where Can i search for reference on this operation?
Reason is analyzing the execution time being taken by an application.
We have an application which has the business logic in 2 different ways. Want to know which logic is taking minimum CPU execution time in terms of business logic. For this reason, displaying time at starting and ending of program for analyzing the time difference manually precisely!
It's working fine for a COBOL program but for a CICS transaction, i'm finding difficult in calling this assembler routine using CICS-COBOL.
Joined: 13 Nov 2010 Posts: 55 Location: Brampton, Ontario, Canada
If you really want fine timing, use the Store Clock Extended instruction (STCKE) along with the STCKCONV macro. That will give you timings to approximately 244 picoseconds. I have no idea why you would want it that fine but there it is.
As others have stated here, that gives you clock time, not CPU time.