/********************************************************************/ /* GRAFTAPE - Tape Capacity Planning in Graphical Form */ /* This member contains a new style SAS macro GRAFTAPE that produces*/ /* graphical representations of the data in your TREND database for */ /* tape drives and tape mounts based on the MXG tape mount monitor */ /* and on the HSC and LSM data produced by an STK silo. In all cases*/ /* the existence of the data is not required and if not present, no */ /* graph is produced just an MXGNOTE that there was no data in the */ /* SASLOG. If you were at CMG94 and saw Chuck's presentation on */ /* Tape Capacity Planning, this is the program that created the */ /* graphs used in that paper spiffed up and wrapped in a macro. */ /* */ /* Each graph is in the form of a surface chart (area below the line*/ /* on a plot filled with a solid color) overlaid with a regression */ /* used to predict future activity. One of the neat features of this*/ /* technique is that SAS puts the regression formula in the SASLOG */ /* for each by group. */ /* */ /* By default, a graph is produced for each device and week but */ /* there is an option to produce the graphs by shift as well as by */ /* device should that be a requirement for you. */ /* */ /* Parameters and their defaults and usage: */ /* COMPANY=Merrill Consultants Tape Capacity Planning */ /* A place for you to place you company name. This is used */ /* to build the first line of the title on each graph. */ /* weekstrt=null value */ /* The earliest week you want used on the horizontal axis */ /* of the plots as a SAS date literal. To start your graph */ /* on January 1, 1997 you would specify weekstrt='01jan97'd */ /* WEEKEND =null value */ /* The latest week you want used on the horizontal axis */ /* of the plots as a SAS date literal. To end your graph */ /* on January 1, 1999 you would specify weekstrt='01jan99'd */ /* NOTE: The weekstrt and weekend parameters are not strictly needed*/ /* since if you omit them the code will use the earliest week found */ /* in the data for each dataset as the starting point and the latest*/ /* week found+1 year as the end point of the regression. */ /* TREND=TREND */ /* The DDNAME or LIBNAME of the TREND database. */ /* INTALO=null value */ /* A stub of code that can be used to limit the data for the*/ /* allocation monitor. For example, if you have 3420 devices*/ /* but don't care to see the plots for these devices, using */ /* INTALO=IF DEVICE=:'3420' THEN DELETE;, would exclude them*/ /* from the analysis. This is building the INCODE= operand */ /* for a VMXGSUM invocation. */ /* INTMNT=null value */ /* INHSC =null value */ /* Same as INTALO but for the tape mount monitor and HSC/LSM*/ /* data respectively. */ /* BYSHIFT=NO */ /* Change this to YES to get a separate plot for each SHIFT.*/ /* GOUT=TRNDTAPE */ /* The name of the output graphics catalog. */ /* TRENDOUT=TREND */ /* The DDNAME/LIBNAME where the graphics catalog eill live. */ /* NEWCAT=YES */ /* Nuke the old graphics catalog til it twinkles. */ /* DISPLAY=NODISPLAY */ /* To display the graphs as you build them or not? That is */ /* the question. Valid values are NODISPLAY or DISPLAY. */ /* HREFS=null value */ /* Places you want a vertical line on the plot as SAS date */ /* literals (eg '01sep96'd 18DEc96'd) separated by spaces. */ /* This gives you a way to mark important events in time. */ /* "How well did we do with that last change?" is easier to */ /* answer if you can point to a line and say here is where */ /* the change was made and you can see the effect... */ /* VREFS=null value */ /* Same concept as HREFS but less useful since the axes are */ /* not consistent across plots. */ /********************************************************************/ %macro graftape( company=Merrill Consultants Tape Capacity Planning, weekstrt=, /* low week on plots */ weekend=, /* high week on plots */ trend=trend, /* input trend ddname */ intalo=, /* incode for trndtalo */ intmnt=, /* incode for trndtape */ inhsc=, /* incode for trndhsc */ byshift=NO, /* produce graphs by shift? */ gout=TRNDTAPE, /* output graphics catalog */ TRENDOUT=TREND, /* output trend database */ newcat=YES, /* nuke the old gcat */ hrefs=, /* Horizontal references */ vrefs=, /* Vertical references */ DISPLAY=NODISPLAY /* DISPLAY/NODISPLAY */ ); %if %sysprod(graph) eq 1 %then %do; goptions reset gouttype=independent ftext=swiss &DISPLAY htitle=1.5 htext=1; options nodsnferr novnferr nobyline; %let byshift=%upcase(&byshift); %let newcat=%upcase(&newcat); %let trndtmnt=0; %let trndtalo=0; %let trndhsc=0; %if &newcat eq YES %then %do; proc datasets ddname=&trendout mt=cat; delete &gout; %end; proc copy indd=&trend outdd=work mt=data; select tapemnts trndtalo trndhsc trndlsm; data _null_; call symput('trndtmnt',nobs); stop; set tapemnts nobs=nobs; data _null_; call symput('trndtalo',nobs); stop; set trndtalo nobs=nobs; data _null_; call symput('trndhsc',nobs); stop; set trndhsc nobs=nobs; data _null_; thisweek=today()-weekday(today())+2; call symput('thisweek',thisweek); run; %if &trndtmnt ne 0 %then %do; %vmxgsum(indata=tapemnts, outdata=trndmnts, sumby=device %if &byshift eq YES %then %do; shift %end; WEEK, sum=nummnts tapmnttm, max=mntmax, keepin=DATETIME, incode= &intmnt week=datepart(datetime); format week date.; if week=&thisweek then delete;, outcode=tapmnttm=tapmnttm/nummnts;); proc means data=trndmnts noprint; var week; output out=tmntrnge min=minweek max=maxweek; data _null_; set tmntrnge; %if %length(&weekstrt) ne 0 %then %do; if minweek lt &weekstrt then minweek=&weekstrt; %end; %if %length(&weekend) ne 0 %then %do; maxweek=&weekend; %end; %else %do; maxweek=maxweek+7*52; %end; weeks=floor(maxweek-minweek)/7; points=ceil(weeks/24)*7; call symput('tmntlow',minweek); call symput('tmnthi',maxweek); call symput('tmntpnts',points); run; proc gplot data=trndmnts gout=&trendout..&gout nocache; by device %if &byshift eq YES %then %do; shift %end; ; plot nummnts*week nummnts*week/overlay haxis=axis1 %if %length(&hrefs) ne 0 %then %do; HREF=&HREFS %end; %if %length(&Vrefs) ne 0 %then %do; VREF=&VREFS %end; areas=1 ; plot2 nummnts*week; axis1 label=('Week Beginning') minor=none order=&tmntlow to &tmnthi by &tmntpnts; label nummnts='Total Mounts'; symbol1 i=join v=none c=g; symbol2 i=rl v=none c=orange w=3; symbol3 i=none v=none c=g; pattern1 c=g v=s; pattern2 c=orange v=e; format nummnts 8.0; title1 "&company"; title2 'Total Tape Mounts'; %if &byshift eq NO %then %do; title3 'Device - #byval1'; %end; %else %do; title3 'Device - #byval1 Shift - #byval2'; %end; label device='Device'; proc gplot data=trndmnts gout=&trendout..&gout nocache; by device %if &byshift eq YES %then %do; shift %end; ; plot tapmnttm*week tapmnttm*week/overlay haxis=axis1 %if %length(&hrefs) ne 0 %then %do; HREF=&HREFS %end; %if %length(&Vrefs) ne 0 %then %do; VREF=&VREFS %end; areas=1 ; plot2 tapmnttm*week; axis1 label=('Week Beginning') minor=none order=&tmntlow to &tmnthi by &tmntpnts; label tapmnttm='Avg Mount Time'; symbol1 i=join v=none c=g; symbol2 i=rl v=none c=orange w=3; symbol3 i=none v=none c=g; pattern1 c=g v=s; pattern2 c=orange v=e; format tapmnttm time8.1; title1 "&company"; title2 'Average Mount Delay'; %if &byshift eq NO %then %do; title3 'Device - #byval1'; %end; %else %do; title3 'Device - #byval1 Shift - #byval2'; %end; label device='Device'; proc gplot data=trndmnts gout=&trendout..&gout nocache; by device %if &byshift eq YES %then %do; shift %end; ; plot mntmax*week mntmax*week/overlay haxis=axis1 %if %length(&hrefs) ne 0 %then %do; HREF=&HREFS %end; %if %length(&Vrefs) ne 0 %then %do; VREF=&VREFS %end; areas=1 ; plot2 mntmax*week; axis1 label=('Week Beginning') minor=none order=&tmntlow to &tmnthi by &tmntpnts; label mntmax='Max Mount Time'; symbol1 i=join v=none c=g; symbol2 i=rl v=none c=orange w=3; symbol3 i=none v=none c=g; pattern1 c=g v=s; pattern2 c=orange v=e; format mntmax time8.0; title1 "&company"; title2 'Maximum Mount Delay'; %if &byshift eq NO %then %do; title3 'Device - #byval1'; %end; %else %do; title3 'Device - #byval1 Shift - #byval2'; %end; label device='Device'; %end; %else %do; %put MXGNOTE: No tape mount data was found on the TREND database; %put MXGNOTE: and no graphs could be produced for this data; %end; %if &trndtalo ne 0 %then %do; %vmxgsum(indata=trndtalo, outdata=trndtalo, sumby=device %if &byshift eq YES %then %do; shift %end; week, incode= &intmnt week=datepart(TIMESTMP); thisweek=today()-weekday(today())+2; if week=&thisweek then delete; if week ge 0; format week date.;, keepin=TIMESTMP, sum=tapedrvs duratm talbkt1-talbkt8, norm1=talbkt1-talbkt8/duratm, max=maxdrvs, outcode=avgdrvs=tapedrvs/duratm;); proc means data=trndtalo noprint; var week; output out=talornge min=mintalo max=maxtalo; data _null_; set talornge; %if %length(&weekstrt) ne 0 %then %do; if mintalo lt &weekstrt then mintalo=&weekstrt; %end; %if %length(&weekend) ne 0 %then %do; maxtalo=&weekend; %end; %else %do; maxtalo=maxtalo+7*52; %end; weeks=floor(maxtalo-mintalo)/7; points=ceil(weeks/24)*7; call symput('talolow',mintalo); call symput('talohi',maxtalo); call symput('talopnts',points); run; proc gplot data=trndtalo gout=&trendout..&gout nocache; by device %if &byshift eq YES %then %do; shift %end; ; plot avgdrvs*week avgdrvs*week/overlay haxis=axis1 %if %length(&hrefs) ne 0 %then %do; HREF=&HREFS %end; %if %length(&Vrefs) ne 0 %then %do; VREF=&VREFS %end; areas=1; plot2 avgdrvs*week; axis1 label=('Week Beginning') minor=none order=&talolow to &talohi by &talopnts; label avgdrvs='Avg Drives'; format avgdrvs 8.0; symbol1 i=join v=none c=g; symbol2 i=rl v=none c=orange w=3; symbol3 i=none v=none c=g; pattern1 c=g v=s; pattern2 c=orange v=e; title1 "&company"; title2 'Average Concurrent Device Allocations'; %if &byshift eq NO %then %do; title3 'Device - #byval1'; %end; %else %do; title3 'Device - #byval1 Shift - #byval2'; %end; proc gplot data=trndtalo gout=&trendout..&gout nocache; by device %if &byshift eq YES %then %do; shift %end; ; plot maxdrvs*week maxdrvs*week/overlay haxis=axis1 %if %length(&hrefs) ne 0 %then %do; HREF=&HREFS %end; %if %length(&Vrefs) ne 0 %then %do; VREF=&VREFS %end; areas=1; plot2 maxdrvs*week; label maxdrvs='Max Drives' minor=none; format maxdrvs 8.0; symbol1 i=join v=none c=g; symbol2 i=rl v=none c=orange w=3; symbol3 i=none v=none c=g; pattern1 c=g v=s; pattern2 c=orange v=e; title1 "&company"; title2 'Maximum Concurrent Device Allocations'; proc gplot data=trndtalo gout=&trendout..&gout nocache; by device %if &byshift eq YES %then %do; shift %end; ; plot talbkt8*week talbkt8*week/overlay haxis=axis1; %if %length(&hrefs) ne 0 %then %do; HREF=&HREFS %end; %if %length(&Vrefs) ne 0 %then %do; VREF=&VREFS %end; areas=1; plot2 ta;bkt8*week; label talbkt8='% Less Than 60' minor=none; format talbkt8 8.0; symbol1 i=join v=none c=g; symbol2 i=rl v=none c=orange w=3; symbol3 i=none v=none c=g; pattern1 c=g v=s; pattern2 c=orange v=e; title1 "&company"; title2 'Concurrent Device Allocations'; %if &byshift eq NO %then %do; title3 'Device - #byval1'; %end; %else %do; title3 'Device - #byval1 Shift - #byval2'; %end; %end; %else %do; %put MXGNOTE: No tape allocation data was found in the TREND; %put MXGNOTE: database and no graphs could be created.; %end; %if &trndhsc ne 0 %then %do; %vmxgsum(indata=trndhsc, outdata=trndhsc, sumby= %if &byshift eq YES %then %do; SHIFT %end; week, sum=nummnts enteject moves hejects, keepin=datetime mountscr mountnsc, incode= nummnts=sum(mountscr,mountnsc,0); week=datepart(datetime); format week date.; if week ge &thisweek then delete;); proc means data=trndhsc noprint; var week; output out=talornge min=minhsm max=maxhsm; data _null_; set talornge; %if %length(&weekstrt) ne 0 %then %do; if minhsm lt &weekstrt then minhsm=&weekstrt; %end; %if %length(&weekend) ne 0 %then %do; maxhsm=&weekend; %end; %else %do; maxhsm=maxhsm+7*52; %end; weeks=floor(maxhsm-minhsm)/7; points=ceil(weeks/24)*7; call symput('hsclow',minhsm); call symput('hschi',maxhsm); call symput('hscpnts',points); run; PROC GPLOT data=trndhsc gout=&trendout..&gout nocache; %if &byshift eq YES %then %do; by shift; %end; PLOT NUMMNTS*WEEK NUMMNTS*WEEK/OVERLAY areas=1 %if %length(&hrefs) ne 0 %then %do; HREF=&HREFS %end; %if %length(&Vrefs) ne 0 %then %do; VREF=&VREFS %end; haxis=axis1; PLOT2 NUMMNTS*WEEK; axis1 label=('Week Beginning') minor=none order=&hsclow to &hschi by &hscpnts; label nummnts='Number of Mounts'; symbol1 i=join v=none c=g; symbol2 i=rl v=none c=orange w=3; symbol3 i=none v=none c=orange w=3; pattern1 c=g v=s; pattern2 c=orange v=e; format nummnts 8.0; LABEL NUMMNTS='Tape Mounts'; title1 'MBNA Information Services - Tape Mount Statistics'; title2 "HSC Statistics - Mounts"; %if &byshift eq YES %then %do; title3 "Shift - #byval1"; %end; PROC GPLOT data=trndhsc gout=&trendout..&gout nocache; %if &byshift eq YES %then %do; by shift; %end; PLOT hejects*WEEK hejects*week/overlay areas=1 %if %length(&hrefs) ne 0 %then %do; HREF=&HREFS %end; %if %length(&Vrefs) ne 0 %then %do; VREF=&VREFS %end; haxis=axis1; PLOT2 hejects*WEEK; label hejects='Number of Ejects'; symbol1 i=join v=none c=g; symbol2 i=rl v=none c=orange w=3; symbol3 i=none v=none c=orange w=3; pattern1 c=g v=s; pattern2 c=orange v=e; format enteject 8.0; LABEL hejects='Ejects'; title1 'MBNA Information Services - Tape Mount Statistics'; title2 "HSC Statistics - Ejects"; %if &byshift eq YES %then %do; title3 "Shift - #byval1"; %end; %vmxgsum(indata=trndlsm, outdata=trndlsm, sumby= %if &byshift eq YES %then %do; SHIFT %end; WEEK, sum=lsbearmu lsbecnt1 lsbecnt2 duratm, norm1=lsbearmu/duratm, keepin=system lsbtime, incode= if system=:'S90A'; week=datepart(lsbtime); format week date.; if week ge &thisweek then delete;); PROC GPLOT gout=&trendout..&gout nocache; %if &byshift eq YES %then %do; by shift; %end; PLOT lsbearmu*WEEK lsbearmu*WEEK/OVERLAY areas=1 %if %length(&hrefs) ne 0 %then %do; HREF=&HREFS %end; %if %length(&Vrefs) ne 0 %then %do; VREF=&VREFS %end; haxis=axis1; PLOT2 lsbearmu*WEEK; label lsbearmu='% Robot Busy'; symbol1 i=join v=none c=g; symbol2 i=rl v=none c=orange w=3; symbol3 i=none v=none c=orange w=3; pattern1 c=g v=s; pattern2 c=orange v=e; format lsbearmu 8.2; LABEL lsbearmu='% Robot Busy'; title1 "&company"; title2 "HSC Statistics - Robot Busy"; %if &byshift eq YES %then %do; title3 "Shift - #byval1"; %end; %end; %else %do; %put MXGNOTE: No HSC data was found in the TREND database and; %put MXGNOTE: therefore no graphs were produced.; %end; proc datasets nolist; delete talornge tmntrnge trndhsc trndlsm tapemnts trndtalo trndmnts; %end; %else %do; %put MXGWARN: SAS/GRAPH is not installed at this installation and member; %put MXGWARN: GRAFTAPE requires SAS/GRAPH to execute. Execution of the; %put MXGWARN: macro GRAFTAPE has been terminated.; %end; %mend graftape;