Title: MXG Tools and Usage
1MXG Tools and Usage
2Agenda
- VMXGPRNT
- VMXGFIND
- VMXGSRCH
- UTILWORK
- READDB2
- UTILBLDP
- VMXGSUM
- ANALCNCR
3VMXGPRNT
- Utility to print any SAS dataset with labels
modified to include the variable name and/or
create a comma delimited output (CSV).
4VMXGPRNT 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
5VMXGPRNT Parameters
- TMPPRNT destination for a temporary dataset
on zOS it will be constructed and dynalloced 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
6VMXGPRNT 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
7VMXGPRNT Example 1
- VMXGPRNT(SP_DSETPDB.DB2ACCT,SP_NOBS3)
- Print PDB.DB2ACCT
8VMXGPRNT Example 1
9VMXGPRNT Example 2
- Create a CSV file
- Filename csv h\mxg\vmxgprnt.csv
- ods csvall filecsv
- vmxgprnt(SP_DSETPDB.DB2ACCT,SP_NOBS3,sp_remvY)
- run
- ods csvall close
- run
-
10VMXGPRNT Example 2
11VMXGFIND
- 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 JOBCICS
12VMXGFIND 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
13VMXGFIND Parameters
- KEEPIN a list of variables that are used in the
comparison - FIND the comparison for example
- JobCICS
- KEEPINSTARTIME STRTTIME INTBTIME,
- FIND IF ('31JAN2010101112'DT LE STARTIME LE
'31JAN2010222324'DT ) - OR ('31JAN2010101112'DT LE STRTTIME LE
'31JAN2010222324'DT ) - OR ('31JAN2010101112'DT LE INTBTIME LE
'31JAN2010222324'DT ) ,
14VMXGFIND Parameters
- PRINT default is NO
- YES print all the observations
- NO no print
- xxx print xxx observations
15VMXGFIND
- If PRINTYES or xxx then VMXGPRNT is used to do
the printing - Example 1
- VMXGFIND(FINDQWHSSSIDDBTB,PRINT3)
16VMXGFIND
17VMXGSRCH
- 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.
18VMXGSRCH Parameters
- LIBNAME the libname to be searched. Default is a
NULL string. _ALL_ will search all allocated SAS
data libraries (they dont 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.
19VMXGSRCH - 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
LOGNO suppresses them. Default is YES
20VMXGSRCH - 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 dont 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
21VMXGSRCH Example 1
- VMXGSRCH( LOGNO,RESULTSCOUNT,
VALUED2DD,LIBNAMEPDB)
22VMXGSRCH- Example 1
23VMXGSRCH Example 2
- VMXGSRCH( LOGNO,RESULTSPRINT,NOBS2,
VALUED2DD,LIBNAMEPDB)
24VMXGSRCH Example 2
25VMXGSRCH Example 3
- VMXGSRCH( LOGNO,RESULTSPRINT,NOBS2,
VALUED2DD,LIBNAMEPDB, COPYTOWORK)
26VMXGSRCH Example 3
27VMXGSRCH Example 4
- VMXGSRCH( LOGNO,RESULTSCOPYONLY,
VALUED2DD,LIBNAMEPDB, COPYTOWORK)
28VMXGSRCH Example 4
29VMXGSRCH Example 5
- VMXGSRCH(VALUECPU,RESULTSLABEL)
- NOTE Values are case sensitive
30VMXGSRCH Example 5
31VMXGSRCH Example 6
- VMXGSRCH(VALUETIME,RESULTSFORMAT)
32VMXGSRCH Example 6
33UTILWORK
- Dont understand the documentation on defining
your workloads to RMFINTRV? This utility will
build you a skeleton RMFINTRV member based on
your TYPE72GO records.
34UTILWORK - Parameters
- PDB may be either SMF or some libname that
contains a TYPE72GO dataset. SMF is preferred
since the normal _ETY72GO exit will suppress
service classes with no activity in an interval.
You only need to use a single RMF interval.
35UTILWORK Parameters
- USEREPRT YES/NO do you want to use report
classes or service classes to define workloads.
Strongly recommended that you use report classes
since there can be many many more at no real cost.
36UTILWORK - Example
- UTILWORK(PDBPDB, OUTFILERMFINTRV,
USERPRTYES, INTERVALQTRHOUR)
37UTILWORK - Example
38READDB2
- MXG supplied macro that generates the code to
read all of the different types of DB2 SMF data
(all IFCIDs). It has been enhanced to make a
copy of the SMF data and allow for selection
based on reading the record headers only which
makes it very fast.
39READDB2
- For a full list of parameters and usage see
READDB2 member in the MXG SOURCLIB - Concentration here will be on selection
parameters and copying of SMF data
40READDB2
- SMFOUT DDNAME to which SMF data will be copied
if blank no copy is made - COPYONLY YES/NO only copy SMF data do not
format SAS datasets - Useful to make mini-SMF files to feed to DB2PM or
send off to vendors - PDBOUT DDNAME to which SAS datasets are written
(WORK is default if left blank)
41READDB2
- SYSTEM list of systems
- PLAN list of plan names
- AUTHID list of authorization IDs
- CORRID list of correlation IDs
- CONNID list of connection IDs
- DB2 list of DB2 subsystems
- CONNTYPE list of connect types
- TRANNAME list of end-user transaction names
- PACKAGE list of package names
42READDB2
- All values in lists separated by spaces
- All parameters separated by commas (except the
last one) - All values are automatically wild carded that
is, however many bytes are in the value is the
length of the compare - SMFBEGN earliest time in form ddmmmyyhhmmss
or 10OCT08150000 - SMFEND latest time in same form
43READDB2
- READDB2(TRANNAMEOLB_DISP, COPYONLYYES,SMFOUTS
MFOUT) - Copy records where TRANNAME starts with OLB_DISP
to SMFOUT DD but do not create SAS datasets - READDB2(TRANNAMEOLB,PDBWORK, SMFOUTSMFOUT)
- Copy records where TRANNAME starts with OLB and
also place them in SAS datasets in the WORK
dataset
44UTILBLDP
- UTILBLDP is a macro designed to simplify adding
records to the normal MXG PDB (performance data
base.) The coding in exits is not difficult if
you understand it all but can be arcane to the
uninitiated. - It can also be used to read multiple kinds of SMF
data in a single pass of the SMF data and create
the SAS datasets in WORK or in a PDB.
45UTILBLDP
- Normally the code to read an SMF record is
- INCLUDE SOURCLIB(TYPE30)
- And to read two types you might code
- INCLUDE SOURCLIB(TYPE30)
- INCLUDE SOURCLIB(TYPE1415)
- But that would cause two passes of the SMF
dataset which can be very large and make this an
expensive and time consuming process. - With UTILBLDP this becomes
- UTILBLDP(USERADD30 1415, BUILDPDBNO,SORTOUTNO,
OUTFILEINSTREAM) - INCLUDE INSTREAM
46UTILBLDP
- For documentation on all parameters and usage see
the member in the MXG SOURCLIB - For our purposes there are only a few important
parameters - SORTOUTNO suppresses sorting and writing of
the data to the PDB DD. You may want to use the
sort (just add a PDB DD to your JCL) as it will
remove any duplicate records. - USERADD a list of the record types you wish to
read 30 6 1415 64 70 etc.
47UTILBLDP
- OUTFILE INSTREAM writes the data to the
temporary dataset defined by the INSTREAM DD. You
can then simply INCLUDE INSTREAM to execute the
code. If you want to STORE the code for future
use (or just to see what the generated code looks
like) route to a PDB member or a sequential
dataset. - BUILDPDBNO suppresses the logic that builds
the full MXG PDB.
48VMXGSUM
- Generalized summarization of ANY SAS dataset
- Uses PROC MEANS to do summarization
- SORTs data
- Allows for changes in input and output data
- Optimizes variables kept
- Carries labels and formats thru summarization
- Allows for long variable names
- Allows for normalization of variables and
changing time intervals
49VMXGSUM
- Common in reporting
- DATA xxxx
- SET yyyy
- PROC SORT DATAxxxx
- PROC MEANS DATAXXXX OUTzzzz
- DATA final
- SET zzzz
50VMXGSUM
- VMXGSUM is a short-hand way of coding a
repetitive set of commands. - Used extensively internally in many MXG members
but especially common in ASUM and TRND
members.
51VMXGSUM - SYNTAX
- VMXGSUM(
- INDATA input dataset(s) name
- OUTDATA output dataset name
- SUMBY list of variables by which data should be
sorted - INCODE a stub of SAS code executed during the
first data step - OUTCODE a stub of SAS code executed during the
final data step
52VMXGSUM - SYNTAX
- INTERVAL how to change the time interval.
Valid values are - QTRHOUR HALFHOUR HOUR THREEHR
- MINUTE WEEK MONTH MYTIME
- DATETIME the variable name of the variable
containing the datetime value on which INTERVAL
will be applied - SYNC59 if your time is synched to 59 minutes,
will add 60 seconds before calculating interval
if set to YES
53VMXGSUM - SYNTAX
- ID list of variables that will be carried
forward as ID values - AUTONAMEYES/NO AUTONAME YES says to use the
autonaming functions of SAS V8 to name the output
variables. - This allows the specification of the same
variable name in multiple lists but changes the
output variable name to variable_suffix where
suffix is the name of the function performed on
the variable.
54VMXGSUM - SYNTAX
- SUM list of variables to be summed
- MAX list of variables to be maxxed
- MIN list of variables to be minned
- MEAN list of variables to be meaned
- P1 list of variables to get percentile 1
- P5 5th percentile variables
- P10 10th percentile variables
55VMXGSUM - SYNTAX
- P25 P50 P75 P90 P95 P99 - percentile values
- STD - Standard Deviation
- VAR - variance
- CV - coefficient of variance
- STDERR - Standard error
- KURTOSIS - Kurtosis
- T - T value
56VMXGSUM - Syntax
- NORM1-NORM99 - normalization of data.
Maintaining rates as rates and not averages of
averages. On the front-end, the rate has to be
multiplied by the duration and on the back end
divided again to recalculate the correct rate.
57VMXGSUM - SYNTAX
- NORM1-NORM99 - syntax
- rate1 rate2 rate3ratex/duration
- List the variables to be normalized followed by a
/ then the variable to be used to do the
normalization.
58VMXGSUM - SYNTAX
- There are other parameters. See the documentation
in the member for usage and the member ADOCSUM.
59VMXGSUM - Example 1
- Summarize the dataset TYPETMNT by DEVICE and
TMNTTIME calculating average mount delay and the
total number of mounts per quarter hour.
vmxgsum( indatapdb.typetmnt,
outdatatapemnts, sumbydevice tmnttime,
intervalqtrhour, datetimetmnttime,
meantapmnttm, freqmounts )
60VMXGSUM - Example 2
- Summarize the Goal Mode type 72 records for the
TSO service class calculating the average
response time, the number of transactions at one
hour intervals by period.
61VMXGSUM - Example 2
VMXGSUM( INDATAPDB.TYPE72GO,
OUTDATATSOSUM, SUMBYSTARTIME PERIOD,
INCODE IF SRVCLASSTSO, SUMRESPAVG
NUMTRAN, NORM1RESPAVG/NUMTRAN,
INTERVALHOUR, DATETIMESTARTIME )
62VMXGSUM Usage Notes
- NORMx operands must be contiguous starting at 1.
That is, you cannot have NORM1 and NORM3 without
a NORM2.
63VMXGSUM Usage Notes
- The first data step is almost always converted to
a VIEW rather than a real data step. - KEEPALLNO is resource intensive and not really
needed except in odd cases. KEEPALLYES is much
preferred. The keep lists on all output
datasets are optimized regardless of KEEPALL
setting.
64Why VMXGSUM?
- So why not just use PROC MEANS with CLASS
operands? - VMXGSUM in tests is usually much more efficient
and in some cases will do the summarization where
using PROC MEANS or PROC SUMMARY with CLASS
operands runs out of memory. - This is especially true with the current release
of SAS (9.1.3 SP4) on zOS which is defaulting to
using THREADS.
65ANALCNCR
- Counts concurrent events. How many of something
were happening at the same time.
66ANALCNCR - History
- Method used in original release of MXG
- DO TIMEBEGIN TO END BY 5
- OUTPUT
- END
- Then add up all the observations with a given
value of TIME. Created a HUGE number of
observations and was cumbersome.
67ANALCNCR - History
- Method used with ANALCNCR
- TIMEBEGINCOUNT1OUTPUT
- TIMEENDCOUNT-1OUTPUT
- Now add up the counts by time and you are done
(basically.) Many many fewer observations.
68ANALCNCR - History
- If there are three tape allocations
- Allocation 1 begins at 0800 ends at 0830
- Allocation 2 begins at 0815 ends at 0825
- Allocation 3 begins at 0820 ends at 0845
69ANALCNCR - History
- MAX of 3 concurrent allocations
- 15 minutes of 1
- 5 minutes of 2
- 5 minutes of 3
- 5 minutes of 2
- 15 minutes of 1
- Old method
- Allocation 1 - 1800/5360 obs
- Allocation 2 - 600/5120 obs
- Allocation 3 - 1500/5300 obs
- Total 780 obs
- New Method
- Each allocation is 2 OBS
- Total 6
70ANALCNCR - Example 1
- How many jobs are running concurrently in class A
average and max.
ANALCNCR(INDATAPDB.JOBS, OUTSUMRYRUNTIME,
SUMBYJOBCLASS, INCODEIF TYPETASKJOB,
INTERVALQTRHOUR, STARTIMEJINITIME,
ENDTIMEJTRMTIME, OTCODESM
AVGRUNCONCURNT/DURATM RENAME
MAXCNCRMAXRUN ) PROC PRINT ID JOBCLASS
TIMESTMP VAR AVGRUN MAXRUN
71ANALCNCR - Example 2
- Now suppose you want the INPUT QUEUE time for the
same job class.
ANALCNCR(INDATAPDB.JOBS, OUTSUMRYQUETIME,
SUMBYJOBCLASS, INCODEIF TYPETASKJOB,
INTERVALQTRHOUR, STARTIMEREADTIME,
ENDTIMEJINITIME, OTCODESM
AVGQUECONCURNT/DURATM RENAME
MAXQUEMAXRUN ) PROC PRINT ID JOBCLASS
TIMESTMP VAR AVGQUE MAXQUE
72ANALCNCR - Example 3
- Now put the two outputs together
DATA JOBSTAT MERGE RUNTIME QUETIME BY JOBCLASS
TIMESTMP PROC PRINT ID JOBCLASS TIMESTMP VAR
AVGQUE AVGRUN MAXQUE MAXRUN