I'm running several jobs and declaring notify <myid>. Now, my requirement is to get all the abend jobs list and send it to user. For that I tried as below:
// IF ABEND | RC > 3000 THEN
//STEP03 EXEC PGM=IEBGENER
//SYSUT1 DD *
JOB CSAEXDM7 HAS ABENDED
//SYSUT2 DD DSN=CSCT.KALYAN.PSQ00.TEST2,DISP=MOD
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
I added these lines as last step of my JCL. This is working fine when the job is abending.
But for JCL error, this is not working. I discussed with concrened groups, and they told as below:
If you look closely at the Messages in the spool, the problem lies here.
To make the step write data into your file, the Step has to run. Now the step will run if and only if there is an abend in the previous step. Now, what happens is, one the previous steps gets an abend and then some step later, it gets a JCL ERROR and stops further processing of the JCL, so the IF ABEND step is never encountered.
Now here is what the solution is:
You will see that if you provide a NOTIFY statement in your job card and provide a ID, the Job completion message goes to that ID. There is a BROADCAST Dataset where this message is stored. If in all your jobs if you have the same ID in the NOTIFY statement all the job completion notice will go to that USER ID’s BROADCAST Dataset, which can be read by a separate job and we can select only those jobs which has a abend message. But to do this, you have to select a ID which can be used in NOTIFY and also you have to find out the BROADCAST Dataset naming convention.
Now my question is, where should I look for these brodcast messages? how can I store them?
Thank you Pedro.. I tried the same. But problem is no <user>.BRODCAST.LIST is getting created. I manually created the same. But it is not working. While I am using LISTBC NONOTICES command from TSO it is saying the following error:
IKJ56961E LISTBC TERMINATED. THE MESSAGE LOG COULD NOT BE ALLOCATED.+
IKJ56961E DYNAMIC ALLOCATION ERROR CODE OF 9700 AND INFORMATION REASON CODE OF
I am not sure either user level broadcast datasets are enabled or not. Can you please tell me how to enable this.