How to run a batch job to search for messages in the OPSLOG and put them in a dataset?
Release : 13.5 14.0
Component : OPS/MVS
I believe the OPSLOG function is what you are looking for. Reference to this function can be found in the link below:
You can run a REXX program that calls the OPSLOG function in many ways. As you mentioned the batch method, here is an example. The JCL below will run a REXX named LEOPDS1 from the SYSEXEC concatenation:
//REXX EXEC PGM=IKJEFT01,PARM='OI LEOPDS1'
//STEPLIB DD DISP=SHR,DSN=prefix.CCLXLOAD
//SYSEXEC DD DISP=SHR,DSN=prefix.REXX
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//LOGOUT DD DISP=(,CATLG,DELETE),
//SYSIN DD DUMMY
//SYSTSIN DD DUMMY
A sample code for the REXX LEOPSD1 could be:
VAR = OPSLOG('EXTRACT DATE(05JAN22) TIME(08:00) ENDTIME(11:00)',
'OUTCOLS(DATE,TIME) CMDRESP(REXX) PREFIX(LOGMSG)')
do i = 1 to logmsg.0
'EXECIO * DISKW LOGOUT (FINIS'
See that the REXX above reads the OPSLOG from Jan, 5 time interval 8 to 11AM and searches for messages with messageid IEF*. The output will go to the LOGOUT dataset.
See the link above for other possible filters you can add to the OPSLOG execution.