View previous topic :: View next topic
|
Author |
Message |
mailsatk
New User
Joined: 15 Apr 2010 Posts: 2 Location: India
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
mailsatk
New User
Joined: 15 Apr 2010 Posts: 2 Location: India
|
|
|
|
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.
Thanks! |
|
Back to top |
|
|
sureshmanokar
New User
Joined: 21 Dec 2010 Posts: 11 Location: Bangalore
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
|