Page 1 of 2

How to send auto notification when the job is completed

PostPosted: Sat Mar 16, 2013 10:19 am
by jatin_compsci
Hi Al,

How we can send auto notification vial email to specific users when our job is completed and abended?.

The scenario is -

My job is scheduled at after every 15 minutes in OPC scheduler

The 2 main instances are of 3:45 PM and 4:04 PM

Suppose if the job fails between 3:45PM and 4 PM an auto triggered mail should get generate to specific people saying "Order processing would be late" and if the jobs runs successfully at 4:04PM then again an auto triggered mail should get generate to specific people saying "Order processing completed successfully".


It would be of great help if anyone can tell me what JCL will look like for this.

Thanks in Advance.

Re: How to send auto notification when the job is completed

PostPosted: Sat Mar 16, 2013 4:14 pm
by NicC
Search the forum, ask you co-workers and network people or whoever supports such requirements.

Re: How to send auto notification when the job is completed

PostPosted: Sat Mar 16, 2013 7:23 pm
by c62ap90
Our IT shop uses PGM=OIMPSMTP. I'm not sure if this is shop specific or not.
Best advice is from NicC above; ask your co-workers (don't be shy!).

Re: How to send auto notification when the job is completed

PostPosted: Sat Mar 16, 2013 8:19 pm
by jatin_compsci
Hi,

I have asked them, but none them has clear information on this. :(

Re: How to send auto notification when the job is completed

PostPosted: Sun Mar 17, 2013 5:34 am
by NicC
Well, you are going to have to speak to the people who support your ftp or whatever you use to send the mail as it is site specific, as you will see from looking at topics relating to e-mail in this forum.

Re: How to send auto notification when the job is completed

PostPosted: Sun Mar 17, 2013 7:27 am
by Robert Sample
If no one at your site has the knowledge of OPC to be able to set up your task, you may have to convince management to hire a consultant to help you do what you want, or plan on spending however long it takes (hours, days, weeks, or months) to do the research to figure it out on your own, or come up with a solution that you can implement. OIMPSMTP is most likely something specific to your site; the default name for the email started task program is SMTP, an alias of EZASMTP.

Re: How to send auto notification when the job is completed

PostPosted: Mon Mar 18, 2013 7:16 pm
by Ed Goodman
The OPC scheduler might have the ability to do this for you. You might have to set up a special mail address and have people subscribe to it using their email server.

Poor man's option would be to create a job/step that sends the email using SMTP protocol. The general form of the job will be, some utility to read in a small data set containing SMTP statements, and writing out those statements to a writer that forwards them to an SMTP server. The research for that would be to scan your jcl/proc/parm libraries for the words 'SMTP' or 'HELO'.

Because you said 'abend' I can't really figure out how to run a step after a job abends. That's why it's probably better to use the scheduler. Worst case, you could write separate jobs for the emails, then tell the scheduler to run it/them depending on what happens.

I cobbled together something horrible once that ran a test schedule every few minutes. The first job would check the status of jobs in the prod scheduler and set a return code. based on that code, it would run one of several jobs sending me a generic email.

Re: How to send auto notification when the job is completed

PostPosted: Mon Mar 18, 2013 7:27 pm
by BillyBoyo

Re: How to send auto notification when the job is completed

PostPosted: Mon Mar 18, 2013 9:00 pm
by jatin_compsci
Hi Goodman,

Thanks a lot for the descriptive reply, SMTP is working fine now, i checked in test environment.

But as you said first job would check the status of jobs in the prod scheduler and set a return code and based on that code, it would run one of several jobs sending me a generic email, but do COND parameter allow the return code of different job to be used in some different job i have heard of return code of previous step only.

or if we use IF condition then also we have to take steps return code as- IF (STEP1.RC = 0) THEN.

It would be great for me if you can explain more on this.

Re: How to send auto notification when the job is completed

PostPosted: Mon Mar 18, 2013 9:17 pm
by jaggz
Hello,

Check if OPC scheduler has the alert notification capability. If, yes then involve the sys prog who is responsible for OPC.

Good luck