Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 78
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: 4650
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: 78
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: 1528
Location: Chennai

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: 1781
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: 6970
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: 1922
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: 78
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: 967
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
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us