//RUNSAS EXEC MXGSAS,WORK='10000,20000' //CICSD1 DD DISP=SHR,DSN=SYS6.BGS.MXG.WEEKLY.CICSTRAN.SYSD(0) //CICSH1 DD DISP=SHR,DSN=SYS6.BGS.MXG.WEEKLY.CICSTRAN.SYSH(0) //SYSIN DD * *options obs=001000 source macrogen symbolgen; options nobyline; ods noproctitle; *------------------------------------ * setup SLAs groups; PROC FORMAT ; picture pct (round) low - high = '0009.999%'; VALUE SLADESC 1='SLA-1 IndAgnt Quik <3 (89-91) ' 2='SLA-2 IndAgnt Quik <5 (98.75-99.25)' 3='SLA-NA IndAgnt Quik >5 ' 4='SLA-3 AllstateQuik <10 (94-96) ' 5='SLA-4 AllstateQuik <20 (98.75-99.25)' 6='SLA-NA AllstateQuik >20 ' 7='SLA-5A IndAgnt Full <7 (89-91) ' 8='SLA-5B IndAgnt Full <17 (97-99) ' 9='SLA-NA IndAgnt Full >17 ' 10='SLA-5C AllstateFull <10 (93-95) ' 11='SLA-5D AllstateFull <20 (97-99) ' 12='SLA-NA AllstateFull >20 ' other='unknown' ; VALUE SECS 0<-1 = '<=01' 1<-2 = '<=02' 2<-3 = '<=03' 3<-4 = '<=04' 4<-5 = '<=05' 5<-6 = '<=06' 6<-7 = '<=07' 7<-8 = '<=08' 8<-9 = '<=09' 9<-10= '<=10' 10<-11= '<=11' 11<-12= '<=12' 12<-13= '<=13' 13<-14= '<=14' 14<-15= '<=15' 15<-16= '<=16' 16<-17= '<=17' 17<-18= '<=18' 18<-19= '<=19' 19<-20= '<=20' 20<-21= '<=21' 21<-22= '<=22' 22<-23= '<=23' 23<-24= '<=24' 24<-25= '<=25' 25<-26= '<=26' 26<-27= '<=27' 27<-28= '<=28' 28<-29= '<=29' 29<-30= '<=30' 30<-60= '<=1m' 60<-120= '<=2m' 120<-180= '<=3m' 180<-240= '<=4m' 240<-300= '<=5m' 300<-360= '<=6m' 360<-HIGH= '>>6m' other='unknown' ; *------------------------------------ * report metadata for SAS dataset; *Proc Contents data=cicsd1.cicstran ; *------------------------------------ * extract job-id using TCB and JSCB; data _null_; length job_id $8; jscbptr = peek(peek(540)+180); ssibptr = peek(jscbptr+316); job_id = peekc(ssibptr+12, 8); call symput('job_id',job_id); run; *------------------------------------ * extract relevant DTP data; data cics (keep=region strttime dtp_hour tranname sla elapstm cputm); set cicsd1.cicstran cicsh1.cicstran ; format sla sladesc.; format dtp_hour datetime10.; region = substr(applid,4,2); if region in('P1','P2','P4','P5') then do; if elapstm < '0:00:00.01't then delete; if tranname = 'ADTP' then do; if elapstm <= 10 then sla = 10 ; else if elapstm <= 20 then sla = 11 ; else sla = 12 ; end; else if tranname = 'BDTP' then do; if elapstm <= 10 then sla = 4 ; else if elapstm <= 20 then sla = 5 ; else sla = 6 ; end; else if tranname = 'IDTP' then do; if elapstm <= 7 then sla = 7 ; else if elapstm <= 17 then sla = 8 ; else sla = 9 ; end; else if tranname = 'QDTP' then do; if elapstm <= 3 then sla = 1 ; else if elapstm <= 5 then sla = 2 ; else sla = 3 ; end; else delete; end; else delete; dtp_hour = intnx('hour', strttime, 0); run; *------------------------------------ * extract earliest and latest dates; proc sort data=cics out=cicsout; by strttime; run; %macro numobs(dsn); %global dtp_n; %let dsid=%sysfunc(open(&dsn)); %let dtp_n=%sysfunc(attrn(&dsid,nobs)); %let rc=%sysfunc(close(&dsid)); %mend numobs; %numobs(cicsout) data _null_ ; set cicsout(firstobs=min); timei=timepart(strttime); datei=datepart(strttime); call symput("st",put(timei,hhmm.)); call symput("sd",put(datei,mmddyy10.)); set cicsout(firstobs=&dtp_n); timei=timepart(strttime); datei=datepart(strttime); call symput("lt",put(timei,hhmm.)); call symput("ld",put(datei,mmddyy10.)); stop; run; *------------------------------------ * define the email file; filename myfile email to=("email@company.com") subject="CICS SLAs - &SD to &LD" type="text/html" ; run; ods html body=myfile rs=none ; *------------------------------------ * report SLAs for all hours; proc sort data=cics out=cics2 ; by sla; run; proc freq data=cics2 order=data; TITLE1 "#BYVAL(TRANNAME) SLAs for D/H CICS, " "from &sd &st to &ld <"; by tranname notsorted; table sla; run; *------------------------------------ * remove hours with >6K orders; proc summary data=cicsout nway missing ; class dtp_hour ; output out=dtpperhour(drop=_type_ rename=_freq_=dtp_count); run; data cicshr1 ; merge cicsout dtpperhour ; by dtp_hour ; if dtp_count > 6000 then delete; run; *------------------------------------ * report SLAs for hours w<6K orders; proc sort data=cicshr1 out=cicshr2 ; by sla; run; proc freq data=cicshr2 order=data; title2 "(limited to hours with <= 6k DTPs per hour)"; by tranname notsorted; table sla; run; *------------------------------------ * report dtp counts per hour along * with avg/max response & cpu times; proc tabulate data=cicsout ; title1 "Hourly stats"; title2; class dtp_hour region; var elapstm cputm ; table (dtp_hour='' all), (region='DTP Counts' all='D&H')*n=''*f=comma9. region='Avg (secs)'*elapstm=''*mean=''*f=comma9.2 region='Max (secs)'*elapstm=''*max=''*f=comma9.2 region='Avg CPU'*cputm=''*mean=''*f=comma8.3 region='Max CPU'*cputm=''*max=''*f=comma8.3 region='Sum CPU'*cputm=''*sum=''*f=comma13.3 / rts=16 ; run; *------------------------------------ * report based on elapsed time; proc tabulate data=cicsout ; title1 "Distribution of DTP counts by the elapsed time (secs)"; footnote1 height=10pt "&sysdate9 &systime &sysjobid(&job_id) user(&SYSUID)"; format elapstm secs.; class tranname elapstm region; table (tranname='' all)*elapstm='', (region='DTP Counts' all='D&H')*n=''*f=comma9. (region='%' all='D&H')*pctn=''*f=pct. / rts=16 ; run; *------------------------------------ * close/send email file; ods html close;