Retrieving audit trail from SMF


The JCL shown below can be coded and submitted to retrieve the audit trail from the SMF log file. Using the sort control fields in this example will remove the SMF header fields from the sorted output record. The sorted output record, with the SMF header removed, is in the proper format to be processed by the File-AID for IMS Audit Trail Print program.

//STEP0001  EXEC  PGM=IFASMFDP
//SYSPRINT  DD  SYSOUT=*
//DUMPIN    DD  DSN=your.system.SMF.log.file,DISP=SHR
//DUMPOUT   DD  DSN=your.name.of.choice,
//              DISP=(NEW,PASS,DELETE),
//              DCB=*.DUMPIN,
//              UNIT=unit,SPACE=(ttt,(nn,nn),RLSE)
//SYSIN     DD  *
 INDD(DUMPIN,OPTIONS(DUMP))
 OUTDD(DUMPOUT,TYPE(your SMF record id))
//*
//STEP0002  EXEC  PGM=SORT,REGION=2048K,COND=(0,LT)
//SYSUDUMP  DD  SYSOUT=D
//SYSPRINT  DD  SYSOUT=*
//SYSOUT    DD  SYSOUT=*
//SORTIN    DD  DSN=*.STEP0001.DUMPOUT,
//              DISP=(OLD,DELETE,DELETE)
//SORTOUT       DD  DSN=your.name.of.choice,
//              DISP=(NEW,CATLG,DELETE),
//              DCB=(RECFM=VB,LRECL=32756,BLKSIZE=32760),
//              SPACE=(ttt,(nn,nn),RLSE),UNIT=unit

//SORTWK01  DD  UNIT=unit,SPACE=(ttt,(nn,nn),RLSE)
//SORTWK02  DD  UNIT=unit,SPACE=(ttt,(nn,nn),RLSE)
//SORTWK03  DD  UNIT=unit,SPACE=(ttt,(nn,nn),RLSE)
//SYSIN     DD  *
  OPTION DYNALLOC
  SORT FIELDS=(60,08,CH,A,
            15,04,CH,A,
            28,24,CH,A,
            81,1,CH,A,
            11,04,CH,A,
            07,04,CH,A)
  INCLUDE   COND=(06,01,CH,EQ,X’xx’(xx=hex representation of SMF ID))
  OUTREC    FIELDS=(1,4,81)
/*
//*
//

Important

For your reference, member XIXATRPT in the sample library SXVJSAMP includes a combined retrieve and print job.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*