Lesson 1: Use z/OS SMF to produce online disk volumes utilisation report
Requirement:
Produce a report lists all available space of all online disk volumes with their associated with storage group name at the time during the SMF log cutoff.
Solution:
The mounted volume serial and its associated storage group name can be contained from SMF type 74 RMF activity of several resources. SMF type 74 subtype 1 DS label SMF74SER, SMF74SGN, SMF74NUM are the serial of the volume mounted, storage group name and device number respectively. Statement 'ERBSMFR 74' can be used to introduce the SMF Type 74 to the SMFgrepper tool. DFSORT with the E15 exit referring to SMFgrepper can create a storage group name report.
The free disk space report can be found in SMF type 19. As type 19 is a fixed format record, DFSORT can easily generate a SMF type 19 report.
The about two reports can be combined together using DFSORT JOINKEY to produce the required report.
//SMF74 EXEC ASMACL,PARM.L='MAP,LET,LIST'
//C.SYSIN DD DISP=SHR,DSN=GREPPER.JCLLIB(GREP)
// DD *
ERBSMFR 74 SMF74 <--- 1
GREPST HEADER=NO <--- 2
*
GREPEM SMF74HDR,SMF74DDS,SMF74DDL,SMF74DDN,SMF74B, <--- 3 *
(SMF74SER,SMF74SGN,SMF74NUM)
END
/*
//L.SYSLMOD DD DISP=(NEW,PASS),DSN=&&GREP, <--- 4
// UNIT=SYSALLDA,SPACE=(CYL,(1,1,1)),
// DCB=(RECFM=U,DSORG=PO,BLKSIZE=32000)
//L.OBJ DD DISP=SHR,DSN=GREPPER.JCLLIB
//L.SYSIN DD *
INCLUDE OBJ(GREP15O)
ENTRY $MODE15
NAME SMF(R) <--- 5
/*
1) introduce type 74 to the program
2) define the beginning of E15 exit with no SMF header extracted to the output
3) extract (SMF74SER,SMF74SGN,SMF74NUM) from SMF74B section in SMF74 record referred by SMF74DDS. The size of SMF74B section is stored in SMF74DDL. The number of SMF74B section is stored in SMF74DDN. The offset (SMF74DDS), length (SMF74DDL), number (SMF74DDN) is defined in SMF74HDR. The SMF74DDS, SMF74DDL, SMF74DDN are the triplet information in the SMF header. The SMF74HDR and SMF74B are the DSECT describing the SMF Type 74 record and SMF type 74B section respectively. The SMF74DDS, SMF74DDL, SMF74DDN, SMF74SER, SMF74SGN, SMF74NUM are DS labels.
4) define a temporary PDS module library to store the SMFgrepper module.
5) define the E15 module name to be referred by DFSORT.
// EXEC PGM=ICETOOL,REGION=20M
//MODLIB DD DISP=SHR,DSN=&&GREP
//TOOLIN DD *
COPY FROM(SMFIN) TO(T1) USING(AM01)
SORT FROM(T2) TO(T3) USING(AM03)
COPY FROM(T3) TO(REPORT1)
COPY JKFROM TO(T4) USING(AM04)
SORT FROM(T4) TO(REPORT) USING(AM05)
/*
//AM01CNTL DD *
OPTION COPY,VLSHRT,VLSCMP
OUTFIL FNAMES=T1,
INCLUDE=(6,1,BI,EQ,19), - SEL SMF-T19
BUILD=(1,4,11,4,DT1,X,7,4,TM4,X,
15,4,X,8X,X,
21,6,X,
53,2,BI,LENGTH=7,X,
55,2,BI,LENGTH=7,X,
57,2,BI,LENGTH=7,X,
59,2,BI,LENGTH=7,X,
61,2,BI,LENGTH=7)
OUTFIL FNAMES=T2,
INCLUDE=(6,1,BI,EQ,74,AND,
23,2,BI,EQ,1) - SEL SMF-T74, SUBTYPE=1
/*
//AM03CNTL DD *
MODS E15=(SMF,102400,MODLIB)
INREC BUILD=(1,4,5,14,19,2,HEX)
SORT FIELDS=(5,6,CH,A)
SUM FIELDS=NONE
/*
//AM04CNTL DD *
JOINKEYS F1=T1,FIELDS=(37,6,A),TASKID=TA
JOINKEYS F2=T3,FIELDS=(5,6,A),TASKID=TA
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,4,F1:5,23,F2:11,8,F1:36)
/*
//AM05CNTL DD *
SORT FIELDS=(5,12,CH,A,23,8,CH,D)
/*
Copy step using AM01CNTL extract SMF Type 6 and 72 to different temporary files for further processing.
Sort step using AM03CNTL sorts SMF 72 filtered using SMF E15 and generates disk map report with assoicated with storage group name.
Joinkey step using AM04CNTL merges the disk spare space report with assoicated storage group name information.
The last sort step using AM05CNTL generates a formatted report.