Technical Blog Post
Abstract
Do you need to generate a report on statistics that have been archived?
Body
You have a need to pull select statistics from archived ESDS statistics files to generate a report. First you will need to create a ESDS/KSDS pair of the archived ESDS file(s).
1. Log onto the C:D IUI.
2. Go to the ADMIN menu.
3. Go to the INQ menu.
4. Enter IDIR. On this panel you can enter a starting date and ending date range that you know the desire statistics are in or you can blank out Start Date to get everything. You will still need to have some idea of the
date range you are looking for. This should provide you with the GDG that will have the desire data on it.
5. Using JCL similar to the following. You change the INPUT DD statement to the archived generation(s) that the desired data is on, give the ESDS01 and KSDS01 VSAM files in the IDCAMS a name meeting
your standards but not the same as your production statistics files. You will want to use the attributes for your statistics VSAM files instead of what is shown below.
//JOBCARD JOB (ACCT INFO),'***',NOTIFY=&SYSUID,CLASS=T,
// MSGCLASS=X,MSGLEVEL=(1,1)
//ARCHIVE EXEC PGM=IDCAMS
//INPUT DD DSN=YOUR.ARCHIVED.STATISTICS.FILE.GnnnnV00,
// DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
/* */
/* DELETE ANY EXISTING VSAM FILES */
/* */
DELETE (YOUR.STATS.ESDS01) CLUSTER
DELETE (YOUR.STATS.KSDS01) CLUSTER
/* */
/* RESET THE CONDITION CODE IF THE DELETES FAILED BECAUSE */
/* THE DATA SETS WERE NOT FOUND */
/* */
IF MAXCC=8 THEN SET MAXCC=0
/* */
/* DEFINE THE STATISTICS FILE PAIRS; A PAIR IS COMPOSED OF */
/* AN ESDS FOR THE LOG AND A KSDS WHICH SERVES AS AN INDEX */
/* INTO THE LOG. */
/*
DEFINE CLUSTER -
(NAME(YOUR.STATS.ESDS01) -
CYLINDERS(900) -
VOLUMES(USER59) -
NONINDEXED -
NOIMBED -
REUSE -
RECORDSIZE(275 1600) -
SHAREOPTIONS(2)) -
DATA -
(CONTROLINTERVALSIZE(4096) -
NAME(YOUR.STATS.ESDS01.DATA))
DEFINE CLUSTER -
(NAME(YOUR.STATS.KSDS01) -
VOLUMES(USER55) -
INDEXED -
NOIMBED -
REUSE -
NOREPLICATE -
FREESPACE(10 5) -
KEYS (27 0) -
RECORDSIZE(32 78) -
SHAREOPTIONS(2)) -
DATA -
(CONTROLINTERVALSIZE(4096) -
CYL(500) -
NAME(YOUR.STATS.KSDS01.DATA)) -
INDEX -
(CONTROLINTERVALSIZE(512) -
NAME(YOUR.STATS.KSDS01.INDEX))
IF MAXCC = 0 -
THEN REPRO INFILE(INPUT) -
OUTDATASET(YOUR.STATS.ESDS01)
//*
//STEP1 EXEC PGM=DMSTBKEY
//STEPLIB DD DISP=SHR,DSN=YOUR.CD.LINKLIB
//ESDS01 DD DISP=SHR,DSN=YOUR.STATS.ESDS01
//KSDS01 DD DISP=SHR,DSN=YOUR.STATS.KSDS01
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*
NOTE: Once you have run this job do not rename the datasets that you created. The KSDS has the name of the ESDS in it and if you rename them you will need to run the DMSTBKEY step again to rebuild the KSDS.
Once you have built your archived ESDS/KSDS pair you can now use this dataset as input to a DMBATCH batch job. The following JCL will do a Select Statistics (SEL STAT) from a ESDS/KSDS pair that was created from a archived copy of statistics. The ARCHDSN parameter in the commands provides the name of the KSDS that points into the ESDS that contains the statistics record you desire to report on. The FILE parameter directs the raw records from the ARCHDSN to be written to the dataset pointed to by the TMPDD=TEMPDSN parameter.
//JOBCARD JOB (ACCT INFO),'XXXXXXXXXXX',MSGCLASS=A,CLASS=S,
// NOTIFY=&SYSUID
//DMBATCH EXEC PGM=DMBATCH,PARM='YYSLN'
//STEPLIB DD DISP=SHR,DSN=YOUR.CD.SDGALINK
//SYSUDUMP DD SYSOUT=*
//DMPUBLIB DD DISP=SHR,DSN=YOUR.CD.SDGAPROC
//DMMSGFIL DD DISP=SHR,DSN=YOUR.CD.MSG
//DMNETMAP DD DISP=SHR,DSN=YOUR.CD.NETMAP
//APITRACE DD SYSOUT=*
//TEMPDSN DD DSN=YOUR.CD.SELSTATS,DISP=(NEW,CATLG,DELETE),UNIT=SYSALLDA,
// DCB=(DSORG=PS,RECFM=VBA,LRECL=4100,BLKSIZE=4104),
// SPACE=(CYL,(400,25))
//DMPRINT DD SYSOUT=*
//SYSIN DD *
SIGNON TMPDD=TEMPDSN
SEL STAT WHERE ( -
ARCHDSN=YOUR.CD.STATS.RECOVER.KSDS01 -
TYPE=(*) -
EXCLUDE=(WTO,MEMB) -
) FILE
SIGNOFF
//*
If you do not code the ARCHDSN parameter the SEL STAT will be processed against the active statistics that are allocated at initialization time. This job is set to create raw statistics records in the TEMPDSN dataset to be used as input to a user written program to report the data that the user wants to report on. If the user does not code the TMPDD parameter on the SIGNON command and codes PRINT instead of FILE you will get a sysout similar to the display in the IUI when doing select statistics.
UID
ibm11123467