How to send auto notification when the job is completed



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

How to send auto notification when the job is completed

Postby jatin_compsci » Sat Mar 16, 2013 10:19 am

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.
jatin_compsci
 
Posts: 17
Joined: Wed Feb 13, 2013 1:30 pm
Has thanked: 1 time
Been thanked: 0 time

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

 

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

Postby NicC » Sat Mar 16, 2013 4:14 pm

Search the forum, ask you co-workers and network people or whoever supports such requirements.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

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

Postby c62ap90 » Sat Mar 16, 2013 7:23 pm

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!).
c62ap90
 
Posts: 125
Joined: Thu Oct 11, 2012 10:24 pm
Has thanked: 1 time
Been thanked: 6 times

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

Postby jatin_compsci » Sat Mar 16, 2013 8:19 pm

Hi,

I have asked them, but none them has clear information on this. :(
jatin_compsci
 
Posts: 17
Joined: Wed Feb 13, 2013 1:30 pm
Has thanked: 1 time
Been thanked: 0 time

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

Postby NicC » Sun Mar 17, 2013 5:34 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

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

Postby Robert Sample » Sun Mar 17, 2013 7:27 am

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

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

Postby Ed Goodman » Mon Mar 18, 2013 7:16 pm

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.
Ed Goodman
 
Posts: 342
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

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

Postby BillyBoyo » Mon Mar 18, 2013 7:27 pm

BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

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

Postby jatin_compsci » Mon Mar 18, 2013 9:00 pm

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.
jatin_compsci
 
Posts: 17
Joined: Wed Feb 13, 2013 1:30 pm
Has thanked: 1 time
Been thanked: 0 time

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

Postby jaggz » Mon Mar 18, 2013 9:17 pm

Hello,

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

Good luck
User avatar
jaggz
 
Posts: 356
Joined: Fri Jul 23, 2010 8:51 pm
Has thanked: 8 times
Been thanked: 4 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post