how to send email after successful completion of the job



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

how to send email after successful completion of the job

Postby ganeshvrnj » Sat Mar 19, 2016 11:07 am

how to send email after successful completion of the job ?
ganeshvrnj
 
Posts: 6
Joined: Wed Mar 02, 2016 10:03 am
Has thanked: 0 time
Been thanked: 0 time

Re: how to send email after successful completion of the job

Postby Aki88 » Sat Mar 19, 2016 11:57 am

Hello,

Hope you did a search for your query on the forum and Google, prior posting; there are numerous solutions available readily for this query.
Refer this recent post, it explains how you can send emails using SMTP (with and without attachments, you'll be required to tweak your JCL a li'l bit though).

Once you understand how an email can be sent, then you have multiple choices:
a. If the job in question is scheduler driven, then look at the scheduler email-ing mechanism, for example TWS can trigger emails depending on specific job return codes (check the manuals or speak to your site's job scheduling team on how this can be done)
b. If the job in question is non-scheduler driven, then look at the mechanism which is expected to trigger you next job - add an SMTP step to the same by testing earlier job's return code. Note - the job completion code is set to the highest return code of any step, or if the job's execution fails because of an ABEND, the job completion code is set to the last ABEND code. So you NEED to build a mechanism that can test this completion code. If you have z/OS 1.13 or higher you can use JOBRC parameter to set condition codes for a JOB and then refer them back (word of caution - be very careful before using this setup).

Lastly, prior to designing anything on the lines of your requirement, you need to clarify what is meant by - 'successful completion of the job'; for some JCLs, a RC - 4 is acceptable, for some only RC - 0 is acceptable; and so on and so forth. Once you have this clarity and you know how the next job is to be triggered, then you can choose any of the above options and rig up a solution.

Hth.
Aki88
 
Posts: 381
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 36 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post