/****************************** REXX *******************************/ /* CSMF16 */ /* */ /* Sample REXX to extract selected fields from DFSORT SMF type 16 */ /* records and format to CSV as described in Trevor Kingsbury's */ /* "Recommendations for Tuning Large DFSORT Tasks" paper on the */ /* DFSORT home page. */ /* */ /* Refer to the ICESMF macro in DFSORT library ICEUSER for the */ /* layout of the SMF type 16 record and descriptions of its */ /* fields. */ /*********************************************************************/ ARG debug NUMERIC DIGITS 15 IF debug = "DEBUG" THEN TRACE A ADDRESS TSO /*********************************************************************/ DO FOREVER "EXECIO 1 DISKR SMF16IN" IF rc ¬= 0 THEN SIGNAL l990 PARSE PULL inrec rectype = C2X(SUBSTR(inrec,2,1)) IF rectype ¬= 10 THEN ITERATE smfdate = SUBSTR(C2X(SUBSTR(inrec,7,4)),3,5) smftime = C2D(SUBSTR(inrec,3,4)) smftime1 = smftime % 100 smfhh = smftime1 % 3600 smfhh = RIGHT("0"||smfhh,2) smfmm = (smftime1 % 60) - (smfhh * 60) smfmm = RIGHT("0"||smfmm,2) smfss = smftime1 - (smfhh * 3600) - (smfmm * 60) smfss = RIGHT("0"||smfss,2) smftimef = smfhh||":"||smfmm||":"||smfss lpar = SUBSTR(inrec,11,4) jobname = SUBSTR(inrec,15,8) stepno = C2D(SUBSTR(inrec,39,1)) datasct@ = C2D(SUBSTR(inrec,57,4)) - 4 + 1 stepname = SUBSTR(inrec,datasct@+2,8) twoe32 = 4294967296 iceexrc1 = C2D(SUBSTR(inrec,datasct@+120,4)) iceexrc2 = C2D(SUBSTR(inrec,datasct@+124,4)) iceexrcs = (iceexrc1 * twoe32) + iceexrc2 iceexby1 = C2D(SUBSTR(inrec,datasct@+128,4)) iceexby2 = C2D(SUBSTR(inrec,datasct@+132,4)) iceexbys = (iceexby1 * twoe32) + iceexby2 icecput = C2D(SUBSTR(inrec,datasct@+18,4))/100 icekeyln = C2D(SUBSTR(inrec,datasct@+28,2)) icewblk = C2D(SUBSTR(inrec,datasct@+30,4)) icendyna = C2D(SUBSTR(inrec,datasct@+35,1)) iceflby2 = C2D(SUBSTR(inrec,datasct@+36,1)) SELECT WHEN iceflby2 = 128 THEN sorttype = "S" WHEN iceflby2 = 64 THEN sorttype = "M" WHEN iceflby2 = 32 THEN sorttype = "C" OTHERWISE sorttype = "O" END icetimes = C2D(SUBSTR(inrec,datasct@+40,4)) icedates = C2X(SUBSTR(inrec,datasct@+44,4)) icetimee = C2D(SUBSTR(inrec,datasct@+48,4)) icedatee = C2X(SUBSTR(inrec,datasct@+52,4)) elapstm = (icetimee - icetimes) / 100 IF icedatee ¬= icedates THEN elapstm = elapstm + 86400.00 normbyte = C2D(SUBSTR(inrec,datasct@+56,1)) IF normbyte = 0 THEN normterm = "Y" ELSE normterm = "N" iceavlr = C2D(SUBSTR(inrec,datasct@+60,4)) icedsa = C2D(SUBSTR(inrec,datasct@+64,2)) iceinio = C2D(SUBSTR(inrec,datasct@+84,4)) iceoutio = C2D(SUBSTR(inrec,datasct@+92,4)) icewkio = C2D(SUBSTR(inrec,datasct@+100,4)) icehspu = C2D(SUBSTR(inrec,datasct@+154,4)) icedspu = C2D(SUBSTR(inrec,datasct@+160,4)) IF elapstm > 60.00 THEN DO outrec = smfdate ||";"|| smftimef ||";"||, lpar ||";"|| jobname ||";"||, stepno ||";"|| stepname ||";"||, normterm ||";"|| sorttype ||";"||, elapstm ||";"|| icecput ||";"||, iceexrcs ||";"|| iceavlr ||";"||, icekeyln ||";"|| iceexbys ||";"||, icendyna ||";"|| icewblk ||";"||, iceinio ||";"|| iceoutio ||";"||, icewkio ||";"|| icehspu ||";"||, icedspu PUSH outrec "EXECIO * DISKW SMF16OUT" END END L990: "EXECIO 0 DISKR SMF16IN (FINIS" "EXECIO * DISKW SMF16OUT (FINIS" EXIT