blueshantung

System Logger Reader | z/OS Mainframe

This program extracts console/syslog messages from the MVS System Logger logstream using multi-block reads. Data can be extracted for the previous, current day or between specified dates with filters for Jobname, System ID, Message and Search text.

Download

ZIP
V2.01 is available on CBT Tape file #747

History

2.01
(06/10/2006) - Steve Mowles supplied a fix for a bug in the LeapSeconds and TimeOffset.
2.02
(08/02/2007) - Message ID is now checked from the first non-blank character - thanks Robin!
2.03
(02/12/2010) - Adding to the above fix, we check past an asterisk or plus sign - thanks Liz!
2.04
(01/02/2011) - Reports any incorrect parameters and fixed issue with parentheses. Search option added.
2.05
(21/01/2014) - Reworked macro calls due to changes in z/OS 1.13 - thanks Mauro Melli!
3.0
(21/05/2021) - Converted to relative addressing and new opcodes available with OPTABLE(ZS6). Updated ABEND codes and moved error messages to WTOs.
3.0.1
(02/03/2022) - Program failed in LLA when linked as RENT - traced to TIME, STCKCONV and CONVTOD macros which hadn't been converted to reentrant.

Planned Changes

  1. None

Screenshots / Output

Description & Parameters

This program is used to extract system log data from the MVS System Logger logstream. All parameters are specified in DD:SYSIN - different filters can be used on the data.

START(yyyyjjj.hhmm) 
Start date and time
END(yyyyjjj.hhmm)
End date and time
SYS(ssss)
System name
MSG(mmmmmmmmmmmm)
Message ID
JOB(jjjjjjjjjjjj)
Jobname
SEARCH(sssssss)
Search argument
SYSLOG
Display output like SYSLOG (different format)
NOHEADER
Do not display the headers
TODAY
Use todays date from 00:00 to current time
YESTERDAY
Use yesterdays date from 00:00 to 23:59

You can specify multiple systems, messages and jobnames separated by a space, for the length of the line.

JCL Setup

//STEP1     EXEC PGM=LOGR64                                                     
//STEPLIB   DD DISP=SHR,DSN=YOUR.LOADLIB                                 
//LOGOUT    DD SYSOUT=*                                                         
//SYSIN     DD *                                                                
  Parameter 1
  Parameter 2
  Parameter 3...
/*                                                                              
					
DD:LOGOUT is required for the output. We run a started task at 00:01 daily to write to a GDG dataset to capture the previous days' log:

//DAILYLOG PROC                                          
//*                                                      
//STEP1   EXEC PGM=LOGR64                                
//LOGOUT    DD DISP=(,CATLG),DSN=SYS0.SYSLOGS(+1),       
//             SPACE=(TRK,(8000,800),RLSE),              
//             DCB=(BLKSIZE=4320,LRECL=240,RECFM=FB)     
//SYSIN     DD DISP=SHR,DSN=OWDATA.SOFTWARE(DAILYLOG)
//SYSPRINT  DD SYSOUT=*        				
					
In this example, LOGR64 resides in a LINKLIST dataset. The DD:SYSIN contains the parameters (starting in column 3):

NOHEADER
SYSLOG
YESTERDAY
					

Abend or Error Codes

U0001
No SYSIN DD specified
U0002
Invalid parameter
U0003
Invalid Start Date
U0004
Invalid End Date
U0005
Cannot connect to logstream
U0006
Cannot start a browse function in logstream
U0007
Cannot read from the logstream
U0008
Cannot convert date to STCK

R6 and R7 contain RETCODE and RSNCODE for diagnosis.

Environment

This program was written in z/OS HLASM Assembler and will run under z/OS 64bit. The code is re-entrant.
No additional authorisations are required.

This program was developed and tested up to z/OS 2.4.

Assemble & Link

The program is a single source member and the JCL has been set up to create an object file and link into a load module. The JCL runs under JES3 so you will probably need to tailor it for your environment.