REXX SMF

REXX SMF is the code you require to read and process SMF data with a REXX procedure.

You can email me if you have questions at alan@nichols.de


The source is here REXX SMF
This is a TSO transmit format dataset, to unpack it ftp it to OS/390 using binary transfer lrecl=80 recfm=fb and blksize=3120 (One track is enough).

Then use the TSO command RECEIVE INDATASET(mydata) where mydata is the name of the dataset your transfered to MVS via ftp.

Here is some JCL to start your run.

//********************************************************************* 
//***       SMF READ PROGRAM                                        *** 
//***       TO OUTPUT USE DUMP OR NODUMP AS PARAMETER               *** 
//********************************************************************* 
//STEP0010  EXEC  PGM=IKJEFT01,PARM='%READSMF DUMP'                     
//SYSEXEC   DD    DISP=SHR,DSN=TCP0.CSTM.EXEC                           
//DUMPIN    DD    DISP=SHR,DSN=                  
//DUMPOUT   DD    DISP=(,PASS),SPACE=(CYL,(100,50)),UNIT=SYSDA,DSN=&&DP 
//SYSIN     DD    DISP=SHR,DSN=TCP0.CSTM.CONTROL(SMF118)                
//WORKSMF   DD    DISP=SHR,DSN=TCP0.CSTM.OUTPUT.SMF(SMF)                
//TELNETS   DD    DISP=SHR,DSN=TCP0.CSTM.OUTPUT.SMF(TELNET)             
//FTPS      DD    DISP=SHR,DSN=TCP0.CSTM.OUTPUT.SMF(FTP)                
//APIS      DD    DISP=SHR,DSN=TCP0.CSTM.OUTPUT.SMF(API)                
//TELNETC   DD    DISP=SHR,DSN=TCP0.CSTM.OUTPUT.SMF(TELNETC)            
//FTPC      DD    DISP=SHR,DSN=TCP0.CSTM.OUTPUT.SMF(FTPC)               
//SYSTSPRT  DD    SYSOUT=*                                              
//SYSPRINT  DD    SYSOUT=*                                              
//SYSTSIN   DD    DUMMY                                                 
//********************************************************************* 
//***       CREATE SORT PARM TO ELIMINATE DUPLICATES AND KEEP 31 DAYS** 
//********************************************************************* 
//*-------------------------------------------------------------------- 
//STEP0020  EXEC  PGM=IRXJCL,PARM=SMFSORT                               
//SYSEXEC   DD    DISP=SHR,DSN=TCP0.CSTM.CEXEC                          
//CARD      DD    DISP=SHR,DSN=TCP0.CSTM.CONTROL(S118TS)                
//SYSTSPRT  DD    SYSOUT=*                                              
//SYSPRINT  DD    DUMMY                                                 
//SYSTSIN   DD    DUMMY                                                 
//SYSIN     DD    DUMMY                                               
//********************************************************************
//***       RUN SORT TO ACHEIVE ABOVE                               **
//********************************************************************
//STEP0030  EXEC  PGM=ICEMAN                                          
//SYSIN     DD    DISP=SHR,DSN=TCP0.CSTM.CONTROL(S118TS)              
//SORTIN    DD    DISP=SHR,DSN=TCP0.CSTM.OUTPUT.SMF(TELNET)           
//          DD    DISP=SHR,DSN=TCP0.CSTM.OUTPUT.SMF(TELNETO)          
//SORTWK01  DD    UNIT=3390,VOL=SER=EWORK1,SPACE=(CYL,(300,100))      
//SORTWK02  DD    UNIT=3390,VOL=SER=EWORK2,SPACE=(CYL,(300,100))      
//SORTOUT   DD    DISP=SHR,DSN=TCP0.CSTM.OUTPUT.SMF(TELNETO)          
//SYSOUT    DD    SYSOUT=*                                            


You should preallocate the PDS-E TCP0.CSTM.OUTPUT.SMF to be large as it contains all your decoded SMF data. Mine looks like this PO-E VB 32756 32760. Create a member called TELNETO in this PDS-E with nothing in it before your first run.

TCP0.CSTM.CONTROL(SMF118) contains the select statements for the SMF records you are interested in ie:

OUTDD(DUMPOUT,TYPE(118))   
INDD(DUMPIN,OPTIONS(DUMP)) 
TCP0.CSTM.CONTROL(S118TS) contains sort statements required to remove duplicates namely

SORT FIELDS=(5,166,CH,A)          
SUM FIELDS=NONE                   
INCLUDE COND=(5,5,CH,GT,C'99067') 
I generate it with a simple rexx so that the date field is always correctly set.
/*REXX make the CONTROL STATEMENETS FOR THE SMF SORT */    
datej=DATE('J')  /*yyddd*/                                 
year=substr(datej,1,2)                                     
day=substr(datej,3,3)                                      
day=day-30                                                 
if day < 1 then do;day=day+366;year=year-1;end             
day=right(day,3,"0")                                       
mydate=year||day                                           
QUEUE " SORT FIELDS=(5,166,CH,A)"                          
QUEUE " SUM FIELDS=NONE"                                   
QUEUE " INCLUDE COND=(5,5,CH,GT,C'"mydate"')"              
"EXECIO 3 DISKW CARD ( FINIS"                              
"EXECIO * DISKR CARD ( STEM CARD. FINIS"                   
do index = 1 to card.0                                     
   say date() time() "ALTCP001I " card.index               
end