1.02k likes | 1.31k Views
MXG Tools and Usage. Chuck Hopf. Agenda. ANALID ANALGRID VMXGPRNT VMXGFIND VMXGSRCH UTILWORK READDB2 UTILBLDP VMXGSUM ANALCNCR ANALCAPD. ANALID. New MACRO to create an SMF Audit dataset and report READSMF=NO PRINT=YES PDBOUT=PDB PERCENTS=YES ODS parameters.
E N D
MXG Tools and Usage Chuck Hopf
Agenda • ANALID • ANALGRID • VMXGPRNT • VMXGFIND • VMXGSRCH • UTILWORK • READDB2 • UTILBLDP • VMXGSUM • ANALCNCR • ANALCAPD
ANALID • New MACRO to create an SMF Audit dataset and report • READSMF=NO • PRINT=YES • PDBOUT=PDB • PERCENTS=YES • ODS parameters
ANALID – READSMF • READSMF=YES will read an SMF dataset. The default of NO is used in BUILDPDB to read the ID dataset already being created. • Driven by the value of the SMFAUDIT macro variable in VMXGINIT. If set to NO with a %LET the older style report is created with fewer variables.
ANALID – PRINT/PDBOUT/PERCENTS • PRINT=YES – prints SMF Audit report. To suppress the report specify NO. • PDBOUT=PDB – the destination of the new SMFRECNT dataset. • PERCENTS=YES – calculates the percentage of the data for each system represented by a single type/subtype.
ANALID – ODS Parameters • ODSTYPE= if you want to create HTML output specify HTML or specify some other valid ODS value. If blank ODS is not used. • ODSPATH= the pathname for the ODS output – typically a directory on ASCII or a PDSE or zFS directory on zOS • ODSFILE= the name of the output that will be created
ANALID - Example %ANALID( READSMF=YES, PDBOUT=PDB, PRINT=YES, ODSTYPE=HTML, ODSPATH=E:\. ODSFILE=ANALID.HTML);
ANALGRID • Creates a dense color coded grid of values using PROC REPORT • Does not require SAS/GRAPH • Works on all SAS versions 9.1.3 and above
ANALGRID • Example 1 • Read ASUM70LP and for the specified system create a grid of CPU busy for a day. • This is the default with addition of an INCODE to select a specific LPAR %ANALGRID(INCODE=IF LPARNAME=SYSG;);
ANALGRID • Example 2 – compare year to year same month excluding weekdays and holidays • %ANALGRID( • INDATA=RMFINTRV, • SORTBY=SYSTEM MONTH, • SYSTEM=SYSG, • INCODE=MONTH=DATEPART(STARTIME)-DAY(DATEPART(STARTIME))+1; • FORMAT MONTH MONYY.; • if 1 lt weekday(datepart(startime)) lt 7; • if month(datepart(startime))=1; • if datepart(startime) not in('26dec11'd,'24nov11'd,'25nov11'd, • '05sep11'd,'04jul11'd,'30may11'd,'21feb11'd,'17jan11'd,'24dec10'd, • '25nov10'd,'26nov10'd,'16jan12'd,'02jan12'd,'16jan12'd,'20feb12'd);, • TITLE1=% CPU Busy, • VARIABLE=pctcpuby,VARLABEL=% CPU,varformat=5.2, • ROWVARIABLE=DATE,ROWLABEL=DATE,ROWFORMAT=DATE., • ODSPATH=e:,ODSFILE=april.html);
ANALGRID • You have complete control of • Colors and levels • Column and row variables • Column and row labels • Column and row formats
ANALGRID • %ANALGRID( • SYSTEM=SYSG, • INDATA=RMFINTRV, • SORTBY=SYSTEM, • VARFORMAT=TIME12.2, • dates=lastweek, • BKT1='01:00'T/BLUE/WHITE, • BKT2='02:00'T/GREEN/WHITE, • BKT3='03:00'T/CYAN/BLACK, • BKT4=, • WEIGHT=, • SORTLABEL=System, • STAT=SUM, • VARIABLE=CPUTM, • odspath=e:, • odsfile=cputime.html, • VARLABEL=CPU TIME, • COLVARIABLE=TIME,COLLABEL=TIME,COLFORMAT=TIME5., • ROWVARIABLE=DATE,ROWLABEL=DATE,ROWFORMAT=DATE. • );
VMXGPRNT • Utility to print any SAS dataset with labels modified to include the variable name and/or create a comma delimited output (CSV).
VMXGPRNT – Parameters • SP_DSET – dataset to be printed – defaults to _LAST_ • SP_NOBS – number of OBS to be printed – defaults to 20 • SP_REMV – remove * from labels in CSV file – defaults to NO
VMXGPRNT – Parameters • TMPPRNT – destination for a temporary dataset – on zOS it will be constructed and dynalloc’ed as a temporary dataset but on ASCII will be placed in your SASUSER directory. Defaults to TMPPRNT.SAS • BYLST – list of BY variables – defaults to a null string
VMXGPRNT – Parameters • VARLST – list of variables to be printed. Default is a null string which will print all variables • NOEXIMSG – suppresses various warnings/notes – default is YES • SP_OPNS – PROC PRINT options default is SPLIT=‘*’
VMXGPRNT – Example 1 • %VMXGPRNT(SP_DSET=PDB.DB2ACCT,SP_NOBS=3); • Print PDB.DB2ACCT
VMXGPRNT – Example 2 • Create a CSV file • Filename csv ‘h:\mxg\vmxgprnt.csv’; • odscsvall file=csv; • %vmxgprnt(SP_DSET=PDB.DB2ACCT,SP_NOBS=3,sp_remv=Y); • run; • odscsvall close; • run;
VMXGFIND • Utility that will find every OBS in every dataset where some condition is satisfied and make a copy/print the observations. • For example: • Find all obs where JOB=:’CICS’
VMXGFIND – Parameters • PDB= LIBNAME to be searched – default is PDB – can be 1 or many • PDBOUT= where to put the output datasets – datasets here will be named DDNAME_dataset where DDNAME is the libname where they were found
VMXGFIND – Parameters • KEEPIN= a list of variables that are used in the comparison • FIND= the comparison – for example… • Job=:’CICS’ • KEEPIN=STARTIME STRTTIME INTBTIME, • FIND= IF ('31JAN2010:10:11:12'DT LE STARTIME LE '31JAN2010:22:23:24'DT ) OR ('31JAN2010:10:11:12'DT LE STRTTIME LE '31JAN2010:22:23:24'DT ) • OR ('31JAN2010:10:11:12'DT LE INTBTIME LE '31JAN2010:22:23:24'DT ) ;,
VMXGFIND – Parameters • PRINT= default is NO • YES – print all the observations • NO – no print • xxx – print xxx observations
VMXGFIND • If PRINT=YES or xxx then VMXGPRNT is used to do the printing • Example 1: • %VMXGFIND(FIND=QWHSSSID=DBTB,PRINT=3);
VMXGSRCH • Utility that will find every observation in every dataset in every allocated SAS data library where the value of the observation contains some string. • Note: libraries must have been allocated either explicitly (LIBNAME statement) or by a DATA/PROC step.
VMXGSRCH – Parameters • LIBNAME= the libname to be searched. Default is a NULL string. _ALL_ will search all allocated SAS data libraries (they don’t have to be MXG) and anything else will search that specific LIBNAME. Only LIBNAMEs that have been opened will be found!!!!! You may need to insert a LIBNAME on zOS.
VMXGSRCH - Parameters • COPYTO= copy the datasets and observations that match to this LIBNAME • NOBS= the number of OBS to print – default is MAX • LOG= a large number of lines may be generated – LOG=NO suppresses them. Default is YES
VMXGSRCH - Parameters • VALUE – the value to search for • Results= what you want us to do • PRINT – just print the obs/datasets that match • COPYONLY – copy the datasets but don’t print • COUNT – just produce a count of datasets/obs/variables that match • LABEL – produce a list of variables/datasets where the value is in the label • FORMAT – produce a list of variables/datasets where the value is in the format
VMXGSRCH – Example 1 • %VMXGSRCH( LOG=NO,RESULTS=COUNT, VALUE=D2DD,LIBNAME=PDB);
VMXGSRCH – Example 2 • %VMXGSRCH( LOG=NO,RESULTS=PRINT,NOBS=2, VALUE=D2DD,LIBNAME=PDB);
VMXGSRCH – Example 3 • %VMXGSRCH( LOG=NO,RESULTS=PRINT,NOBS=2, VALUE=D2DD,LIBNAME=PDB, COPYTO=WORK);
VMXGSRCH – Example 4 • %VMXGSRCH( LOG=NO,RESULTS=COPYONLY, VALUE=D2DD,LIBNAME=PDB, COPYTO=WORK);