IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri May 06, 2011 12:17 pm
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
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: 1742
Location: Tirupur, India

PostPosted: Fri May 06, 2011 1:17 pm
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: 1788
Location: Bloomington, IL

PostPosted: Fri May 06, 2011 3:48 pm
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
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: 2455
Location: Hampshire, UK

PostPosted: Fri May 06, 2011 4:10 pm
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

Superior Member


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

PostPosted: Fri May 06, 2011 4:16 pm
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
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

Superior Member


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

PostPosted: Mon May 09, 2011 4:08 pm
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

Senior Member


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

PostPosted: Mon May 09, 2011 5:00 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Fetch data from programs execute (dat... DB2 3
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
Search our Forums:

Back to Top