Lesson 2: Use z/OS SMF to produce Websphere MQ statistics report
Requirement:
Produce a report about WebSphere MQ QMST, QPST SMF statistics.
Solution:
MQ records QMST and QPST statistics into SMF regularly. The SMF record type is 115.
//QPST EXEC ASMACL,PARM.L='MAP,LET,LIST'
//C.SYSLIB DD DISP=SHR,DSN=SYS1.MACLIB
// DD DISP=SHR,DSN=CSQ.SCSQMACS
//C.SYSIN DD DISP=SHR,DSN=GREPPER.JCLLIB(GREP)
// DD *
CSQDQWST DSECT=YES,SUBTYPE=1 <=== 1
*
GREPST HEADER=YES <=== 2
QPST GREPDM QWS1, SMF DSECT NAME <=== 3
QWS10R3O+SM115END-SM115, SMF OFFSET TO CSQDQPST
QWS10R3L+SM115END-SM115, SMF LENGTH
QWS10R3N+SM115END-SM115 SMF COUNT
END
/*
//L.SYSLMOD DD DISP=(NEW,PASS),DSN=&&GREP,
// 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 QPST(R)
/*
//QMST EXEC ASMACL,PARM.L='MAP,LET,LIST'
//C.SYSLIB DD DISP=SHR,DSN=SYS1.MACLIB
// DD DISP=SHR,DSN=CSQ.SCSQMACS
//C.SYSIN DD DISP=SHR,DSN=GREPPER.JCLLIB(GREP)
// DD *
CSQDQWST DSECT=YES,SUBTYPE=1
*
GREPST HEADER=YES
QMST GREPDM QWS1, SMF DSECT NAME <=== 3
QWS10R1O+SM115END-SM115, SMF OFFSET TO CSQDQMST
QWS10R1L+SM115END-SM115, SMF LENGTH
QWS10R1N+SM115END-SM115 SMF COUNT
END
/*
//L.SYSLMOD DD DISP=(NEW,PASS),DSN=&&GREP,
// 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 QMST(R)
/*
1) introduce type 115 to the program
2) extract the first 24 bytes of the SMF header.
3) extract QMST or QPST section offset from QWS10R1O, QWS10R3O with length QWS10R1L, QWS10R3L and count QWS10R1N, QWS10R3N. The triplet information is required to be adjusted by the SMF header length as the DS labels are not offset from the standard SMF header.
// EXEC PGM=ICETOOL,REGION=20M
//MODLIB DD DISP=SHR,DSN=&&GREP
//TOOLIN DD *
COPY FROM(SMFIN) TO(T1) USING(COMM)
COPY FROM(T1) TO(T2) USING(QPST)
COPY FROM(T2) TO(REPORT)
COPY FROM(T1) TO(T2) USING(QMST)
COPY FROM(T2) TO(REPORT)
/*
//COMMCNTL DD *
*
* FILLER OUT SMF 115 SUBTYPE 2
*
OPTION COPY,VLSHRT,VLSCMP
INCLUDE COND=(6,1,BI,EQ,115,AND,
23,2,BI,EQ,2) - SEL SMF-T115 STYPE 2
/*
//QPSTCNTL DD *
*
MODS E15=(QPST,102400,MODLIB)
OUTFIL FNAMES=T2,
INCLUDE=(37,4,BI,GT,0),
BUILD=(1,4,11,4,DT3,X,7,4,TM4,
X,19,4,
X,29,4, QPSTEYEC
X,33,4,BI,LENGTH=3, QPSTPOOL
X,37,4,BI,LENGTH=6, QPSTNBUF
X,41,4,BI,LENGTH=6, QPSTCBSL
X,45,4,BI,LENGTH=6, QPSTCBS
X,49,4,BI,LENGTH=6, QPSTGETP
X,53,4,BI,LENGTH=6, QPSTGETN
X,57,4,BI,LENGTH=6, QPSTRIO
X,61,4,BI,LENGTH=6, QPSTSTW
X,65,4,BI,LENGTH=6, QPSTTPW
X,69,4,BI,LENGTH=6, QPSTWIO
X,73,4,BI,LENGTH=6, QPSTIMW
X,77,4,BI,LENGTH=6, QPSTDWT
X,81,4,BI,LENGTH=6, QPSTDMC
X,85,4,BI,LENGTH=6, QPSTSTL
X,89,4,BI,LENGTH=6, QPSTSTLA
X,93,4,BI,LENGTH=6) QPSTSOS
/*
//QMSTCNTL DD *
*
MODS E15=(QMST,102400,MODLIB)
OUTFIL FNAMES=T2,
INCLUDE=(37,4,BI,GT,0),
BUILD=(1,4,11,4,DT3,X,7,4,TM4,
X,19,4,
X,29,4, QMSTEYEC
X,33,4,BI,LENGTH=8, QMSTOPEN
X,37,4,BI,LENGTH=8, QMSTCLOS
X,41,4,BI,LENGTH=8, QMSTGET
X,45,4,BI,LENGTH=8, QMSTPUT
X,49,4,BI,LENGTH=8, QMSTPUT1
X,53,4,BI,LENGTH=8, QMSTINQ
* X,57,4,BI,LENGTH=8, QMSTINQL
X,61,4,BI,LENGTH=8, QMSTSET
* X,65,4,BI,LENGTH=8, QMSTENDW
X,69,4,BI,LENGTH=8) QMSTCALH
/*
Copy step using COMMCNTL extract SMF Type 115 subtype 2 to a temporary file for further processing.
Copy step using QPSTCNTL extract QPST sections from SMF 115 using SMF E15 and generates QPST report.
Copy step using QMSTCNTL extract QMST sections from SMF 115 using SMF E15 and generates QMST report.