Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Procedure - Not to execute last step if called from diff JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rexx77

New User


Joined: 14 Apr 2008
Posts: 73
Location: Mysore

PostPosted: Fri May 06, 2011 11:59 am    Post subject: Procedure - Not to execute last step if called from diff JCL
Reply with quote

Greetings!!!

I have a common procedure which is used by different JCL's. The last step in the Proc sends some email to customers.

I have a requirement now to not send any email if the Proc is executed from particular JCL. Please find the example below.

JCL
A
B
C
D

PROC = P

Now i dont want Proc P to send any mail if executed from 'D' JCL. I am ready to add the change in all other three JCLs.

THanks for your help in this.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri May 06, 2011 12:17 pm    Post subject: Reply to: Procedure - Not to execute last step if called fro
Reply with quote

So, what's your plan?
Back to top
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 73
Location: Mysore

PostPosted: Fri May 06, 2011 12:29 pm    Post subject:
Reply with quote

Hi Superk,

I thought of passing some parms from Executing JCLs. But i am not sure how to validate the parm before the email step.

Would appreciate for any new ideas.

Thanks for your time.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri May 06, 2011 1:17 pm    Post subject:
Reply with quote

Hello,
On your JCLs A, B, C, add a dummy step which will have a return code of 0.
say that you added,
STEP01 which returns a RC of 0.

on the common proc, add the COND parameter to your email sending step.
COND=(0,LT,STEP01)

On the D jcl add a step(STEP01) which will have a RC of 4.

This way the mail step will run only for JCLs A B C & not for D.

Hope it helps.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri May 06, 2011 3:48 pm    Post subject: Re: Procedure - Not to execute last step if called from diff
Reply with quote

What is your criterion for distinguishing "JCLs"? If PROD.JCL(A) and OTHER.JCL(B) both contain a job named FOO (even if the jobs are entirely different otherwise) are they considered different?

rexx77 wrote:
Please find the example below.

JCL
A
B
C
D

PROC = P

Now i dont want Proc P to send any mail if executed from 'D' JCL.

That's not an example; that's a vague and ambiguous notion.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri May 06, 2011 4:09 pm    Post subject:
Reply with quote

actually,
the email step should be a separate proc.
then you can change you jcl to either call both procs or just one.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Fri May 06, 2011 4:10 pm    Post subject:
Reply with quote

A proc is also JCL so what you are saying is you have jcl that calls jcl. But to resolve your problem: make the program name in the last step a symbolic and in your D job set that symbolic to IEFBR14 and in the others whatever your email program is. Or you can do it a complicated way and override the COND for that step, or have 2 procedures - one with the email and one without. So many options and all really fairly simple.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri May 06, 2011 4:16 pm    Post subject:
Reply with quote

Or one another IEBEDIT Job for the JCL "D" - don't include the e-mail step, in this new Job.
Back to top
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 73
Location: Mysore

PostPosted: Mon May 09, 2011 3:28 pm    Post subject:
Reply with quote

Hi All,

Thanks All for your valuable time in this.

The solution for the above problem planned is to remove the email step from the Proc and add the step in the JCL itself. So which ever job has to send mail , it will have email step else it will not have any.

this may not be a good idea, but did not had time to do the experiment.

Thanks all again....
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon May 09, 2011 4:08 pm    Post subject:
Reply with quote

Thanks for posting the final soultion, you've used...icon_smile.gif
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Mon May 09, 2011 5:00 pm    Post subject:
Reply with quote

I like your solution. It separates different functionalities (I could have said functions, but that would have been simpler) into their own modules.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
This topic is locked: you cannot edit posts or make replies. How to supply called sub-program from... dchristensen JCL & VSAM 25 Wed Sep 14, 2016 11:36 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us