Search code examples
cics

How do i get millisecond values using ask time?


I am writing a PLI/CICS code. Trying to figure out a way to get the time value that includes millisecond.

I have tried looking up documentation for CICS ASKTIME and FORMATTIME and did not find a good way to get the millisecond value

So in my code, i am doing a ASKTIME first , followed by the format time.

This is how my code looks like

/* first do a asktime */
EXEC CICS ASKTIME                          
          ABSTIME(CICS_TIMESTAMP);         

/* followed by the formattime */                                          
EXEC CICS FORMATTIME                       
          ABSTIME(CICS_TIMESTAMP)          
          TIME(CICS_TIME);   

At this point, i am able to get the time in HHMMSS format. Can you tell me if there is a way to get the millisecond value as well ?


Solution

  • EXEC CICS FORMATTIME
              ABSTIME(CICS_TIMESTAMP)
              MILLISECONDS(MTIME)
    

    From the CICS manual

    MILLISECONDS(data-area) Returns the number of milliseconds in the current second specified by ABSTIME, as a binary integer in the range 0 - 999.