Saturday, July 19, 2025

Extracting SMF records : SORT vs IFASMFDP

The below job demonstrates two approaches to extracting SMF record types 70 to 79 from a weekly SMF dataset.

The goal is to compare the performance of the SORT utility and the IFASMFDP utility.
 
Test job
 
//SORT    EXEC PGM=SORT                                     
//SORTIN DD   DISP=SHR,DSN=SMF.WEEKLY.FILE          
//SORTOUT  DD DSN=USERID.SMF7079.SORT,                     
//            DISP=(NEW,CATLG,DELETE),                      
//            DATACLAS=DCTLARGE,                            
//            SPACE=(CYL,(100,100),RLSE),                   
//            DCB=(RECFM=VBS,BLKSIZE=0,LRECL=32760,DSORG=PS)
//SYSOUT DD SYSOUT=*                                        
//SYSIN DD *                                                
 OPTION COPY,VLSHRT                                         
 INCLUDE COND=(06,1,CH,GE,X'46',AND,    SMF TYPE 70         
               06,1,CH,LE,X'4F')        SMF TYPE 79         
//*                                                         
//IFASMFDP   EXEC PGM=IFASMFDP                                
//SYSPRINT DD SYSOUT=*                                      
//INDD1    DD DISP=SHR,DSN=SMF.WEEKLY.FILE          
//OUTDD1   DD DSN=USERID.SMF7079.IFASMFDP,                 
//            DISP=(NEW,CATLG,DELETE),                      
//            DATACLAS=DCTLARGE,                            
//            SPACE=(CYL,(100,100),RLSE),                   
//            DCB=(RECFM=VBS,BLKSIZE=0,LRECL=32760,DSORG=PS)
//SYSIN    DD *                                            
 INDD(INDD1,OPTIONS(ALL))                                  
 OUTDD(OUTDD1,TYPE(70:79))                                 
 START(0000)                                               
 END(2359)                                                 
/*                                                         
 
Job performance data
 

Step

EXCP

Conn

TCB Time

Elapsed Time

CPU Time

SORT

93,346

209K

6.64 sec

3:47.52

6.75 sec

IFASMFDP

1,403,000

308K

12.09 sec

6:40.17

16.16 sec

 
 
  • SORT completed in nearly half the time of IFASMFDP.
  • CPU usage for IFASMFDP was more than double that of SORT.
  • EXCP count (I/O operations) was significantly higher for IFASMFDP
 
Use SORT for quick and lightweight SMF record extraction.
Of course if you need complex SMF record extraction, you would need go with IFASMFDP.

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.