Question:
Is there a way to scan for history statements?
Answer:
The SCAN and SCANR will only scan members in your librarian master files and will not scan the history record. However, you can use the use the LISTH with the GPO utility to list all history records.
JCL example below: Change the LIST DD sysout statement in STEP2 if you want to route to a dataset.
//STEP01 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB DD DISP=SHR,DSN=YOUR.LIBRARIAN.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER DD DISP=SHR,DSN=YOUR.LIBRARIAN.MASTERFILE
//OSJOB DD DSN=&&TEMP,DISP=(,CATLG),UNIT=SYSDA,
// SPACE=(TRK,(3,1)),DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000),
// VOL=SER=XXXXXX
//SYSIN DD *
-OPT GPO
-OPT INDEX
-OPT LISTH
-SEL NAME= ,EXEC
-END
//STEP2 EXEC PGM=AFOLIBR,PARM='NJTA,NRJS'
//SYSPRINT DD SYSOUT=*
//MASTER DD DSN=YOUR.LIBRARIAN.MASTERFILE,DISP=SHR
//OSJOB DD DUMMY
//SYSIN DD DSN=&&TEMP,DISP=OLD
//INDEX DD SYSOUT=*
//LIST DD SYSOUT=*
/*