Wednesday, January 13, 2021

How to send job completion message to multiple TSO ID's?

Hey!

Let's see how we can make use of NOTIFY parameter and NOTIFY statement in JCL to send job completion message to multiple TSO user ID's. 

I believe 🤞 most of you reading this post would be aware of NOTIFY parameter used in the JOB statement. 

//Z01071A     JOB     1,NOTIFY=&SYSUID

It sends TSO message to the user to notify the success or failure of the job. The user's ID is automatically detected by the JCL, thanks to &SYSUID. SYSUID is a system symbol in JCL. During the run time of the JCL, &SYSUID will be substituted with the user ID under whose authority the job had been submitted.

We can also hardcode the user ID instead of providing &SYSUID.

What if we wanted to send the TSO messages to multiple user ID's?



We can use NOTIFY statement in JCL to send the TSO message 💬 to multiple user ID's. 

The NOTIFY statement is supported by JES2 only, beginning in z/OS V2R3.


JCL with NOTIFY statements and USER parameter.



In the picture shown above, 2 NOTIFY statements are being used right after the JOB statement. 
The USER parameter is used to identify the TSO user ID to whom the job completion status message will be sent. 
The TYPE=MSG indicates that the notification should be sent as a TSO message and MSG is the default when the USER parameter is specified. 
A maximum of 8 NOTIFY statements can be specified in a JCL. 

You can also use the NOTIFY statement to send an email 📧, to the specified email ID, about the job's completion status.

JCL with NOTIFY statement and EMAIL parameter. 

When you are using EMAIL parameter, you can't use the USER parameter as EMAIL and USER parameters are mutually exclusive.

Which of the 2 TYPE parameters work well?

TYPE=USER works like a charm and will notify the specified user ID's by sending a TSO message. The job gets through with EMAIL parameter but I haven't seen an email in my Inbox 😕. I've tried the EMAIL parameter at my site and in the MTM2020 system but in vain. I wish I could look at the email that's been triggered from the NOTIFY statement.

We've hit the bottom of this post...

NOTIFY statements will be of great help when another team has to submit their job(s) based on the completion of job(s) that you or your team submit. You may simply include the participant(s) User ID/email so that they get notified about your job's completion status.

Over to you now. Try the NOTIFY statement at your site. ⚠ If you want to use the EMAIL parameter, ensure that you're providing your Work email ID. 

Hope this helps. Thanks for reading. Hit a Like if this post was useful. Share your questions/suggestions in the Comments section below. 



1 comment:

  1. Thanks Srini, Came to know that we can publish the job status to other users as well. I tried that it worked perfectly. But, NOTIFY EMAIL option haven't worked for me as well :( I did some googling, no luck. Keep this feed updated if you find any way.

    ReplyDelete