Post-Processing von STROBE Profile Reports
REXX-Prozedur zur Analyse von STROBE-Reports
Extracts findings from STROBE report to print on log and to extract on dataset which may be emailed to administrators as precautionary notifications.
/*REXX****************************************************************/ /* XMPSTRCK ..: Analysing COMPUWARE STROBE REPORTS */ /*-------------------------------------------------------------------*/ /* CALLED BY..: IKJEFT1A - TSO */ /* ARGUMENTS..: n/a */ /* CALLS......: XMPABND M - Terminates job with user abend U0001 */ /* FILES......: IN I - input: STROBE report */ /* THRESHLD I - threshold/analytic data */ /* OUT O - output: notifications to adminstration */ /* SYSTSPRT O - warning and messages */ /*-------------------------------------------------------------------*/ /* FUNCTION...: Extracts finding from STROBE report to print on log */ /* and to extract on dataset which may be emailed to */ /* administrators as precautionary notifications. */ /*-------------------------------------------------------------------*/ /* HISTORY....: 10.05.13/GR - V1R0 */ /* 12.05.13/GR: V1.1 Analytic threshold from intput file */ /* 17.05.13/GR: V1.2 Consider ORDER BY colno in #CSS section */ /* 15.07.13/GR: V1.3 Limit number of possible finding by constant */ /* max_findings, if threshold reached, initiate ABEND. */ /* 15.07.13/GR: V1.4 Correction of misreading the report for #CSS */ /* 05.09.14/GR: V2.0 Strobe 5.1 compatibility */ /*********************************************************************/ x = MSG("OFF") parse arg parms /********************************************************************/ /* Debugging? */ /********************************************************************/ if pos("DEBUG",parms) > 0 then do f = pos("DEBUG",parms) parms = delstr(parms,f,5) trace ?I end /********************************************************************/ /* print header */ /********************************************************************/ Version = "2.0" say copies("#",79) say "# XMPSTRCK - STROBE report analytics - V"Version" ", " "date("O")" "time()" #"; say copies("#",79) /********************************************************************/ /* Read threshold/analytic data input file */ /********************************************************************/ address TSO "EXECIO * DISKR THRESHLD (STEM LINE. " cc = rc if cc ^= 0 then do say "No input dataset allocated with DD-Namen THRESHLD." exit 20 end max_findings = 50; cnt_thres = 0; do i=1 to line.0 cnt_thres = cnt_thres + 1 /*****************************************************************/ /* Split parms: */ /* asect=Section aval=total-value asymb=symbol aexcl=to-exclude */ /* aeavg=execution-avarage-value */ /* ==> blank -> aspect not gone be checked */ /*****************************************************************/ parse value line.i with C1 ";" C2 ";" C3 ";" C4 ";" C5 ";" C6 asect.i = strip(C1) atot.i = strip(C2) aeavg.i = strip(C3) asymb.i = strip(C4) aexcl.i = strip(C5) aexcl2.i = strip(C6) afind.i = 0 /* init find count */ end if cc ^= 0 then do say "No threshold/analytic data found in DD-Namen THRESHLD." exit 20 end address TSO "EXECIO 0 DISKR THRESHLD (FINIS" /********************************************************************/ /* check allocation of input and output dataset */ /********************************************************************/ address TSO "EXECIO 1 DISKR IN (STEM LINE. " cc = rc if cc ^= 0 then do say "No input dataset allocated with DD-Namen IN." exit 20 end x = LISTDSI("IN FILE") if x > 4 then do say "Error while checking DD-name IN." exit 20 end indsn = sysdsname inlrecl = syslrecl inrecfm = sysrecfm address TSO "EXECIO 0 DISKW OUT (OPEN" if rc ^= 0 then do say "No or invalid output dataset allocated with DD-name OUT." exit 20 end x = LISTDSI("OUT FILE") if x > 4 then do outdsn = "n/a (temp. dataset supected)" outlrecl = inlrecl outrecfm = inrecfm end else do outdsn = sysdsname outlrecl = syslrecl outrecfm = sysrecfm end /********************************************************************/ /* Informationen ausgeben */ /********************************************************************/ if inlrecl = 121 then strobever = "5" else strobever = "4" /********************************************************************/ /* Informationen ausgeben */ /********************************************************************/ say "STROBE Version ........: "strobever".x" say "STROBE Report IN-DSN ..: "indsn say "Admin Notification OUT : "outdsn say "Record Lenth ....... IN: "right(inlrecl,5)" OUT: "right(outlrecl,5) say "Record Format ...... IN: "right(inrecfm,5)" OUT: "right(outrecfm,5) /********************************************************************/ /* initializations */ /********************************************************************/ cnt_in = 0 last_sect = "" curr_sect = "" curr_shd1 = "" /* current section header line 1 */ curr_shd2 = "" /* current section header line 1 */ findings = 0 hicc = 0 /********************************************************************/ /* read line per line and check for findings */ /********************************************************************/ do while rc = 0 cnt_in = cnt_in + 1 /*****************************************************************/ /* remove asa char from strobe 5.x report */ /*****************************************************************/ if strobever = "5" then line.1 = substr(line.1,2) /* remove ASA char - 121->120 */ if line.1 <> "" then do /************************************************************/ /* get section information and header of section */ /************************************************************/ if curr_shd1 <> "", & curr_shd2 = "" then curr_shd2 = line.1 if curr_shd1 = "", & curr_shd2 = "" then curr_shd1 = line.1 x = pos("#",line.1) if ( x=1 & strobever = "4" ), ! ( x=3 & strobever = "5" ) then do /*******************************************************/ /* section information */ /*******************************************************/ last_sect = curr_sect curr_sect = line.1 curr_asect = word(curr_sect,1) curr_shd1 = "" curr_shd2 = "" end /************************************************************/ /* get total percentage and average cpu time if available */ /************************************************************/ if curr_asect = "#CSS" then do if strobever = "5" then curr_tot = substr(line.1, 69 , 6) else curr_tot = substr(line.1, 52 , 6) w1 = wordpos(curr_tot,line.1) p1 = pos(curr_tot,line.1) /* if w1 = 0 V1.3.1 */ /* number is not */ if (w1 = 0 , /* single number */ ! (w1 > 0 & (p1 < 52 ! p1 > 74) )) then curr_tot = "" /* reset */ else do w2 = wordpos("ORDER BY",line.1) if w2 + 2 = w1 /* isa colnumber */ then curr_tot = "" end if strobever = "5" then curr_avg = substr(line.1, 50 , 10) else curr_avg = substr(line.1, 34 , 10) w1 = wordpos(curr_avg,line.1) /* if w1 = 0 V1.3.1 */ /* number is not */ if (w1 = 0 , /* single number */ ! (w1 > 0 & (p1 < 34 ! p1 > 59) )) then curr_avg = "" /* reset */ else do w2 = wordpos("ORDER BY",line.1) if w2 + 2 = w1 /* isa colnumber */ then curr_avg = "" end end else do if strobever = "5" then curr_tot = substr(line.1, 69 , 6) else curr_tot = substr(line.1, 52 , 6) if strobever = "5" then curr_avg = substr(line.1, 30 , 10) else curr_avg = substr(line.1, 25 , 10) end /************************************************************/ /* format total an average value */ /************************************************************/ if datatype(curr_tot) <> "NUM" then curr_tot = 0 if datatype(curr_avg) <> "NUM" then curr_avg = 0 /************************************************************/ /* search for analytic key: */ /* - current section in internal table */ /* - exclude value not found */ /* - total value exceeded or */ /* - average value exceeded or */ /* - symbol found in line */ /************************************************************/ do i=1 to cnt_thres if asect.i = curr_asect, & pos(aexcl.i,line.1) = 0 , & pos(aexcl2.i,line.1) = 0 , & ( , ( atot.i <> 0 , & curr_tot >= format(atot.i,4 ,2) ), ! ( aeavg.i <> 0 , & curr_avg >= aeavg.i ), ! ( asymb.i <> "" , & pos(asymb.i,line.1) > 0 ) , ) then do afind.i = afind.i + 1 /****************************************************/ /* print notification header */ /****************************************************/ if findings = 0 then do push copies("-",79) push " " push "STROBE Report IN-DSN ..: "indsn push " " push "STROBE Version ........: "strobever".x" push " " push copies("#",79) push "# XMPSTRCK - STROBE report analytics - V"Version, " "date("O")" "time()" #"; push copies("#",79) address TSO "EXECIO 9 DISKW OUT" end /****************************************************/ /* print section and section header */ /****************************************************/ findings = findings + 1 push copies("-",79) push line.1 push curr_shd2 push curr_shd1 push curr_sect push "##### Finding on line "cnt_in":" address TSO "EXECIO 6 DISKW OUT" say "##### Finding on line "cnt_in":" say curr_sect say curr_shd1 say curr_shd2 say line.1 say copies("-",79) end end /************************************************************/ /* if maximum of max_findings reached, signal an error */ /************************************************************/ if findings >= max_findings then do push copies("-",79) push "##### Processing of REXX procedure XMPSTRCK abends." push "##### Check input file and changes in version of STROBE." push "##### Maximum of "max_findings" reached." push copies("-",79) address TSO "EXECIO 3 DISKW OUT" say copies("-",79) say "##### Maximum of "max_findings" findings reached." say "##### Check input file and changes in version of STROBE." say "##### Processing of REXX procedure XMPSTRCK abends." say copies("-",79) signal error end end address TSO "EXECIO 1 DISKR IN (STEM LINE. " end address TSO "EXECIO 0 DISKR IN (FINIS" /********************************************************************/ /* final information */ /********************************************************************/ say "IN Report record count : "cnt_in say "Analytic keys .........: "cnt_thres say "Findings in IN Report : "findings /********************************************************************/ /* findings per section */ /********************************************************************/ say "" say "section ! total > ! exec avg > !"!!, " alt. symbol = ! ignore str = ! findings" say "---------!---------!------------!"!!, "----------------+----------------+---------" do i=1 to cnt_thres say left(asect.i,8)" !", format(atot.i,4,2)" !", format(aeavg.i,3,6)" !", left(asymb.i,14)" !", left(aexcl.i" "aexcl2.i,14)" !", afind.i end if findings > 0 then do say "" say "XMPSTRCK ends with RC=4: "findings" finding(s)!" push "***end***" push "" do i=cnt_thres to 1 by -1 push left(asect.i,8)" !", format(atot.i,4,2)" !", format(aeavg.i,3,6)" !", left(asymb.i,14)" !", left(aexcl.i" "aexcl2.i,14)" !", afind.i end push "---------!---------!------------!"!!, "----------------+----------------+---------" push "section ! total > ! exec avg > !"!!, " alt. symbol = ! ignore str = ! findings" push "" address TSO "EXECIO "cnt_thres+5" DISKW OUT" exit 4 end address TSO "EXECIO 0 DISKW OUT (FINIS" say "XMPSTRCK ends with RC=0: No findings." exit 0 ERROR: address TSO "EXECIO 0 DISKW OUT (FINIS" address TSO "EXECIO 0 DISKR IN (FINIS" say "" If Sysvar(SYSISPF) = "NOT ACTIVE" then do say "XMPSTRCK abends with USER ABEND U0001." address ATTACH "XMPABND" exit 0 end say "XMPSTRCK ends with RC=20." exit 20 /*ERROR: V1.3 */ /* say "Error in Statement at line: "SIGL */ /* say "Statement ................: "SOURCELINE(SIGL) */ /*exit 20 */
Example:
- threshols used:
//THRESHLD DD * #SUS;10.00;3.00;;TOTAL #WTM;10.00;0;;TOTAL;SVC 001 #PSU;35.00;0;;TOTAL #PUP;20.00;0;;TOTAL #CSS;10.00;3.00;;TOTAL
- findings:
############################################################################### # XMPSTRCK - STROBE report analytics - V1.4 13/11/29 14:30:16 # ############################################################################### STROBE Report IN-DSN ..: MYUSER.STROBE.D131129.MYCICS1.REPORTPM ------------------------------------------------------------------------------- ##### Finding on line 11909: #PSU ** PROGRAM SECTION USAGE SUMMARY ** MODULE SECTION 16M FUNCTION % CPU TIME MARGIN OF ERROR 5.46% NAME NAME <,> SOLO TOTAL .00 20.00 40.00 SYSTEM .DB2 DB2 SYSTEM SERVICES 38.20 39.44 .*******************+ ------------------------------------------------------------------------------- ##### Finding on line 12623: #SUS ** SQL CPU USAGE SUMMARY ** SQL SQL STMT EXECUTION TIME/CNT % CPU TIME MARGIN OF ERROR .00% TYPE NAME CNT AVG-TIME TOTAL .00 12.00 24.00 DBRM QRCVFA 24 .771012 16:24:40 23.89 .******************** ------------------------------------------------------------------------------- section ! total > ! exec avg > ! alt. symbol = ! ignore str = ! findings ---------!---------!------------!----------------+----------------+--------- #SUS ! 10.00 ! 3.000000 ! ! TOTAL ! 1 #WTM ! 10.00 ! 0.000000 ! ! TOTAL SVC 001 ! 0 #PSU ! 35.00 ! 0.000000 ! ! TOTAL ! 1 #PUP ! 20.00 ! 0.000000 ! ! TOTAL ! 0 #CSS ! 10.00 ! 3.000000 ! ! TOTAL ! 0 ***end***
For more information how to apply the REXX procedure in an automated STROBE scenario, please see article „Automated STROBE measurement reports and alerts“ on this site.
Comments
Comments are closed.