Example -- Sample Report from SMF 15 and 17 Records
showing 'Opens for Update' and 'Deletes' for Selected DSNAME
The sample SMF report below was created with Spectrum SMF Writer,
the low-cost 4GL SMF report writer. This is a simple example of producing a report from multiple SMF record types. It reads as input the SMF file and selects both the type 15 (DD opened for output or update) and type 17 (dataset deleted) SMF records. (See SMF 15 or SMF 17 record layout.)
This report selects only records with a specific text ("SPFTEMP") somewhere withing the DSNAME. (And note that the DSNAME field is not in the same location in type 15 and type 17 SMF records.)
It then prints a report line for each type 15 or 17 record that refers to "SPFTEMP" dataset. Each report line shows data from either the SMF 15 record or the SMF 17 record. The report is then sorted and grouped by job. (However, in this example only 1 job happened to pass the selection criteria.)
All of this with just a few lines of code!
Why not install a Spectrum SMF Writer trial right now and start making your own SMF reports!
These Spectrum SMF Writer Statements:
INPUT: SMF15 /* GET TYPE 15 DEFINITIONS */
COPY: REC17 /* GET TYPE 17 DEFINITIONS, TOO */
*
***************************************************************
* MOVE DATA FROM DIFF LOCATIONS TO WORK FIELDS *
***************************************************************
COMPUTE: JOBID = WHEN(SMF15RTY=15) ASSIGN(SMF15-JOBID)
ELSE ASSIGN(SMF17-JOBID)
*
COMPUTE: LOGTIME = WHEN(SMF15RTY=15) ASSIGN(SMF15TME)
ELSE ASSIGN(SMF17TME)
*
COMPUTE: DSN = WHEN(SMF15RTY=15) ASSIGN(SMF15-JFCBDSNM)
ELSE ASSIGN(SMF17DSN)
*
COMPUTE: MGMT = WHEN(SMF15RTY=15) ASSIGN(SMF15MCN)
ELSE ASSIGN(' ')
*
COMPUTE: DISP = WHEN(SMF15RTY=15) ASSIGN(SMF15-DISP)
ELSE ASSIGN('DELETE')
*
***************************************************************
* SELECT TYPE 15 AND TYPE 17 RECS FOR SELECTED DSNS *
***************************************************************
INCLUDEIF: (SMF15RTY = 15 OR 17) /* SELECT BOTH 15 AND 17*/
AND DSN : 'SPFTEMP' /* ":" MEANS SCAN FOR TEXT */
*
***************************************************************
* OUTPUT REPORT LINES FROM OUR COMPUTED VALUES. *
***************************************************************
COLUMNS: JOBID('JOB NAME AND READER TIME')
LOGTIME
SMF15RTY(4 'SMF|TYPE' NOACC)
DSN(30 'DATASET NAME')
MGMT('MANAGEMENT|CLASS')
DISP
*
SORT: JOBID SMF15DTE SMF15TME /* SORT ON JOB, THEN DATE & TIME */
BREAK: JOBID SPACE(1) NOTOTALS /* PRT 1 BLANK LINE WHEN JOB CHGS */
*
TITLE: #DATE / 'SMF OPENS FOR UPDATE, AND DELETES' / 'PAGE' #PAGENUM
TITLE: / 'ON DATASETS CONTAINING "SPFTEMP"' /
Produce This SMF Report:
03/19/09 SMF OPENS FOR UPDATE, AND DELETES PAGE 1
ON DATASETS CONTAINING "SPFTEMP"
SMF MANAGEMENT
JOB NAME AND READER TIME LOGTIME TYPE DATASET NAME CLASS DISP
_____________________________ ___________ ____ ______________________________ __________ ______
W0TTRP1 08/02/07 10:55:36.66 12:23:48.47 15 W0TTRP1.SPFTEMP2.CNTL TSO OLD
W0TTRP1 08/02/07 10:55:36.66 12:23:57.47 15 W0TTRP1.SPFTEMP1.CNTL TSO OLD
W0TTRP1 08/02/07 10:55:36.66 12:23:57.65 17 W0TTRP1.SPFTEMP1.CNTL DELETE
****** GRAND TOTAL ( 3 ITEMS)
See other sample SMF reports.