An earlier blog by Vijaya Katikireddy introduced the new consolidated message file DD ADBMSGS which contains messages written into SYSPRINT, REPORT, SYSOUT, and more.
The advantage is that messages are written in a single place and is in sequence. For example, if a CM Batch job ends with an error you can open ADBMSGS, e.g., in SDSF, and do a “F E 9” to locate the error message.
However, the ADBMSGS file can become relatively large and important messages may be hidden in the output. Additionally, if you have built self-service solutions on top of CM Batch the output may be viewed by an (impatient) developer that do not want to scroll through hundreds or even thousands of lines.
For these use cases I have coded a utility that filters the ADBMSGS dataset and produces a developer-friendly version of ADBMSGS with as few lines as possible.
The filtering strategy is as follows:
- Include all ADBxxxxE messages
- Exclude all ADBxxxxW and ADBxxxxI messages except
- If the message follows immediately after an ADBxxxxE message and is from the same module. The reasoning is that ADBxxxxI in some cases provide valuable supporting information to the error message.
- If the message is important to your installation. The utility have a filter where you can specify which messages are important to you. The filter works on three levels:
- message (e.g., include all ADB7953I message);
- message and module (e.g., include all ADB7953I messages from module ADBCMM);
- message, module and phase (e.g., include all ADB7953I messages from module ADBCMM in the Analyze phase).
Here’s a JCL snippet for calling the filtering module ADBRPMSG
//ADBRPMSG EXEC PGM=IKJEFT01
//SYSEXEC DD DSN=hlq.EXEC,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
//ADBMSGS DD DISP=SHR,DSN=hlq.ADBMSGS
//MSGOUT DD SYSOUT=*
//FILTERIN DD *
ADB7953I ADB2CMP ANALYZE
Here’s an example of the output (MSGOUT) from the filtering:
The original ADBMSGS dataset had almost 300 lines. Note that the output includes all ADB7956I message and an error message ADB8007E followed by an information message ADB8057I that is shown because it follows immediately after the error message and is from the same module (ADBCCMM):
ADB7956I ADBCCM CM batch: start of CM batch
ADB7956I ADBCCM CM Batch: Start of Import phase.
ADB7956I ADBCCM CM Batch: End of Import phase.
ADB7956I ADBCCM CM Batch: start of Analyze phase.
ADB8007E ADBCCMM An attempt was made to create a table that already exists.
ADB8057I ADBCCMM Object details at the time of error:
Operation : 50
Row type : TB
Object name : GLWTEMP
Procedure : merge_tables
ADB7956I ADBCCM CM Batch: End of Analyze phase.
ADB0006E ADBCCM ADBCCM - Error(s) found. Please review output.
ADB7956I ADBCCM CM batch: end of CM batch.
For producing a full summary report, you may consider adding the following data sets to the final output:
- DD VALOUT – this dataset contains output from any verification mask
- DD ADBRPTSM – this is the summary report from the execution of managed change or work statement list (WSL)
I have wrapped the following logic inside a JCL procedure:
- Use the SDSF REXX API to retrieve DD ADBMSGS SYSOUT=* from a prior GOCCM step in the same job (if present)
- Run the filtering REXX to produce a short report
- Retrieve DD VALOUT SYSOUT=* from a prior GOCCM step in the same job (if present)
- Add the output to the short report
- Retrieve DD ADBRPTSM SYSOUT=* execution summary report from a prior GOCCM step in the same job (if present)
- Add the output to the short report
- Finally, write the final consolidated short report to SYSOUT=*
Your CM batch job will looks like this:
//PROCLIB JCLLIB ORDER=hlq.PROCLIB
//GOCCM EXEC GOCCM,SSID=ssid,PROFILE=ssid
//ADBMSGS DD SYSOUT=*
//ADBRPTSM DD SYSOUT=*
//VALOUT DD SYSOUT=*
//ADBMSG EXEC ADBMSG,PREFIX=hlq.ADBTMP
The JCL procedure will write a (temporary) dataset to &PREFIX..SDSFTMP and the final consolidated short report is written to &PREFIX..ADBMSG
Disclaimer: I am a novice REXX programmer -- constructive feedback will be appreciated
Download Zip file with attachments: adbmsg.zipView Details
- ADBMSG.proclib: the JCL procedure
- ADBRPMSG.rexx: code to filter ADBMSGS
- ADBGTMSG.rexx: code to retrieve output using the SDSF REXX API