Saturday, July 19, 2025

Interpreting 12 byte format of USRCPUT in CICS SMF 110 records

You are trying to understand the format of fields such as USRCPUT. The old PICTURE clause in DFHCOB was TMRCPUT-TIME PICTURE 9(8) COMP. The new PICTURE clause is S9(8). Looking at the SMF 110 records generated by CICS Transaction Server for z/OS (CICS TS) V3.2 and higher, you find values like x'000000000025CFE0'. The values generated by CICS TS V2.3 and V3.1 are more in the range '00000071'. You want to know, what does the field USRCPUT represent and how to convert it to seconds?

The USRCPUT field for CICS TS V3.2 and higher is a 12 byte field. Basically, clock fields like USRCPUT are now 12 bytes instead of 8 bytes. So, in CICS TS V2.3 the USRCPUT part of the SMF 110 record might look like 00000BC300000007 which you would break it down as follows:

00000BC300000007 - Example 8 byte USRCPUT in releases of CICS prior to CICS TS V3.2 
00000BC3 - CPU time in binary units where the smallest unit is 6 microseconds (bytes 1 to 4)
00 - Reserved bits (byte 5)
000007 - Count of the number of times contributed to the CPU time (bytes 6 to 8)

Now with CICS TS V3.2 and higher you will see something like 000000000BC3F29D00000007 and you would break it down as follows:

000000000BC3F29D - CPU time in binary units where the smallest unit is 16 microseconds (bytes 1 to 8)
00 - Reserved bits (byte 9)
000007 - Count of the number of times contributed to the CPU time (bytes 10 to 12)

Before you could convert the CPU time to seconds by taking 00000BC3 and converting to decimal and multiplying by .000016. But, now you would take the middle 4 bytes of the CPU time (which would give you 00000BC3) and then convert it like you used to. Or, to get a little greater accuracy you could do the following:

   1. Disregard the bottom 3 nibbles of the CPU time
      (leaving you 000000000BC3F) and convert it to decimal.
   2. Multiply the result by .000001 to get the value in seconds.


Below is the sample COBOL code to calculate the USRCPUT time.

*  User task CPU time                         
05  PDRCPUT.                               
    07  PDRCPUT-TIME    PIC X(8).          
    07  PDRCPUT-COUNT   PIC S9(8)   COMP.  
 
05 WS-TEMP-CPU-TIME            PIC 9(18) COMP.        
05 WS-TEMP-CPU-TIME-R REDEFINES WS-TEMP-CPU-TIME     
                              PIC X(08).             
05 WS-TEMP-CPU-TIME-X         PIC X(08).             
05 WS-USRCPUT-TIME            PIC 9(03)V9(06) COMP-3. 

     MOVE PDRCPUT-TIME             TO WS-TEMP-CPU-TIME-R
     MOVE LOW-VALUES               TO WS-TEMP-CPU-TIME-X       
* DROP LAST BYTE                                               
     MOVE WS-TEMP-CPU-TIME-R (1:7) TO WS-TEMP-CPU-TIME-X (2:7) 
     MOVE WS-TEMP-CPU-TIME-X       TO WS-TEMP-CPU-TIME-R       
* DIVIDE BY 16 TO DROP LAST 4 BITS                             
     COMPUTE WS-TEMP-CPU-TIME = WS-TEMP-CPU-TIME / 16          
     COMPUTE WS-USRCPUT-TIME  = WS-TEMP-CPU-TIME * 0.000001.         
 

 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.