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

Conditional Execution of Steps


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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Mar 04, 2011 12:40 pm
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

Superior Member


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

PostPosted: Fri Mar 04, 2011 2:19 pm
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
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
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Mar 04, 2011 4:58 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
No new posts CA7 deleting files in steps after job... CA Products 4
No new posts Conditional EATTR in MFS ? IMS DB/DC 0
No new posts Conditional replace values in output ... DFSORT/ICETOOL 3
No new posts Parallel Sysplex - subprogram execution CICS 7
Search our Forums:

Back to Top