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
 

 

Conditional Execution of Steps

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

New User


Joined: 15 Apr 2010
Posts: 2
Location: India

PostPosted: Fri Mar 04, 2011 11:45 am    Post subject: Conditional Execution of Steps
Reply with quote

Hi!!

Here is my requirement -

I am trying to create 2 files (File1, File2) of different LRECL in the same PROC (at different steps) such that at any given point when the PROC executes, only one of the files is created (either File1 or File2). The Proc executes from 6 different jobs, 5 of which need to create the File1 and 1 job should create the File2.

There are various parms that are being passed in all the 6 jobs and there is a paramter that I can use to identify that the 6th job (that creates File2) is being executed.

In order to implement this, I thought of using IF ELSE ENDIF, but I suppose checking for symbolic parms is not supported by IF conditions. I checked the following link -
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/IEA2B690/17.1.4.5?SHELF=&DT=20090526233806&CASE=

Another way I thought of was to code both the steps in the PROC and override the "not required" steps in the relevant jobs so that they don't execute. But, I find that this is not a very good way to write code - hence I don't want to use this.

Is there any way I can have only one PROC and execute different steps depending on which job executes the Proc?

Any ideas are welcome! Do let me know if I need to provide any more info.

Thanks!
Satish
Back to top
View user's profile Send private message

Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 994
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Mar 04, 2011 12:40 pm    Post subject:
Reply with quote

You could add an IDCAMS step to set MAXCC in each of the 6 jobs. Have the job which is to create File 2 set a different cond code to the others and have the step in the PROC check the cond code.

This might require further changes to cond code checks in the JOBs/PROC.

Garry
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 Mar 04, 2011 2:19 pm    Post subject: Re: Conditional Execution of Steps
Reply with quote

mailsatk wrote:
The Proc executes from 6 different jobs, 5 of which need to create the File1 and 1 job should create the File2.
Would not that be easy and rather maintainable to have one more PROC to create your second file, as you already have different Jobs to execute your PROC...
Back to top
View user's profile Send private message
mailsatk

New User


Joined: 15 Apr 2010
Posts: 2
Location: India

PostPosted: Fri Mar 04, 2011 2:27 pm    Post subject:
Reply with quote

Hmm..yes, it definitely is easy. I think I will go with that approach eventually.

But I want to be sure that there is no other easier way. icon_smile.gif

Thanks!
Back to top
View user's profile Send private message
sureshmanokar

New User


Joined: 21 Dec 2010
Posts: 11
Location: Bangalore

PostPosted: Fri Mar 04, 2011 3:03 pm    Post subject: Reply to: Conditional Execution of Steps
Reply with quote

Heah, its possible using SET keyword.

Refer the below example.

JCL1:-
//PROCLIB JCLLIB ORDER=TSCH156.IBM.FORUMS1
// SET DSNNAME=TSCH156.IBM.NILESH.PS1
//STEP1 EXEC PROCPS
//

JCL2:-

//PROCLIB JCLLIB ORDER=TSCH156.IBM.FORUMS1
// SET DSNNAME=TSCH156.IBM.NILESH.PS2
//STEP1 EXEC PROCPS
//

PROC:-

//PROCPS PROC
//STEP010 EXEC PGM=IDCAMS
//DD01 DD DSN=&DSNNAME,DISP=(,CATLG,DELETE),
// SPACE=(TRK,(1,1),RLSE),DCB=(LRECL=80,RECFM=FB),DSORG=PS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD DUMMY
//PROCPS PEND

Hope this helps you.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 994
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Mar 04, 2011 4:58 pm    Post subject:
Reply with quote

Quote:
Heah, its possible using SET keyword.

Refer the below example.



How does this help the OP? Your example shows a PROC creating a single named file in a PROC with one step, it doesn't show how to create 2 files in the PROC when tbe PROC is used in one JOB and only 1 file in another JOB.

Garry.
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. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm
No new posts output DDname JESMSGLG job during exe... italo_pm TSO/ISPF 16 Tue Jun 21, 2016 11:13 am
This topic is locked: you cannot edit posts or make replies. Executing JCL specific steps at speci... Shruti Takkar JCL & VSAM 6 Mon Feb 22, 2016 12:39 pm
No new posts How steps execute in Job in case of a... richiewalia JCL & VSAM 4 Tue Jan 12, 2016 12:34 pm
No new posts Can a DB2 insert trigger execution of... TS70363 DB2 6 Tue Nov 24, 2015 10:44 pm


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