View previous topic :: View next topic
|
Author |
Message |
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
Hi, I have the following requirement:
My JCL is:
Code: |
XPROC1 EXEC PROC=PROC1
COPY01 EXEC PGM=ICEGENER,COND=(0,NE, ????)
|
Code: |
where PROC1 contains two EXEC PROC= statements:
XPROC2 EXEC PROC=PROC2
contains:
XTHEPGM2 EXEC PGM=THEPGM2
XPROC3 EXEC PROC=PROC3
XTHEPGM3 EXEC PGM=THEPGM3
|
Am I able to code a COND, so that the step COPY01 is only executed if both XTHEPGM2 and XTHEPGM3 returns RC=0?
Thanks,
Claes |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
Back to top |
|
|
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
Thanks, but I already read that page, and I couldn't adopt it to my issue, and I only came here after like 40 tries...
Giving my example, are you able to give the correct syntax, please? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
I believe the answer is "NO":
Quote: |
5.Modifying or additional JCL statements can only have procstepname.name or procstepname.ddname in their name field. Do not specify backward references to nested procedures, such as procstepname.procstepname.ddname DD parameters. |
One of the resons for not using nested procedures. |
|
Back to top |
|
|
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
I believe the answer is NO as well.. However, I really wanted it to be YES Thanks anyways.
Claes |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Do all the steps in the two procs give zero normally? Ie, would it be OK to not run if any step in those two procs gives non-zero? |
|
Back to top |
|
|
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
Bill, I see what you're getting at But the JCL stream I've got is a potentionally long (dynamically generated), and thus it can be a long list of EXEC PROC1 and COPY steps, like this:
Code: |
XPROC1A EXEC PROC=PROC1
COPY01A EXEC PGM=ICEGENER,COND=(0,NE, ????)
XPROC1B EXEC PROC=PROC1
COPY01B EXEC PGM=ICEGENER,COND=(0,NE, ????)
XPROC1C EXEC PROC=PROC1
COPY01C EXEC PGM=ICEGENER,COND=(0,NE, ????)
|
I only wish to execute the COPY step, if the corresponding executing of the PROC step went well.
I am working on a solution to add a step in PROC1 that will test the RC from the two PROC calls with IDCAMS and MAXCC. Any thoughts on that would be great! |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Include your ICEGENER in PROC1? |
|
Back to top |
|
|
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
That would be a good solution, if only PROC1 weren't used throughout our system. What I did is this in PROC1:
Code: |
//IF01 IF (STEP1.PROCSTEP.RC = 0 & STEP2.PROCSTEP.RC = 0) THEN
//ELSE01 ELSE
//CHECK EXEC PGM=IDCAMS
//IN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=member,DISP=SHR
//ENDIF01 ENDIF
member contains:
PRINT INFILE (IN) COUNT (1)
IF LASTCC NE 0 THEN SET MAXCC = 13
|
Then I should be able to test on PROC1.CHECK in the calling job? |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Quote: |
That would be a good solution, if only PROC1 weren't used throughout our system. |
So your proposed change to PROC1 is acceptable?
Could an extra step with a rouge return code throw off someone elses COND statement in their Job?
Would it be safer to create a NEW proc PROC1B to do exactly what you want (the ICEGENER step)? |
|
Back to top |
|
|
Claes Norreen
Active User
Joined: 20 Dec 2005 Posts: 137 Location: Denmark
|
|
|
|
Dave, that may be the end of it - however I'd like to get my solution to work, but it doesn't seem to do so for more than 1 "set" I'll explain..
I have my proc, PROC1:
Code: |
// PROC1 PROC .....
//STEP1 EXEC PROC2
.....
//STEP2 EXEC PROC3
.....
//IF01 IF (STEP1.PROCSTEP.RC = 0 & STEP2.PROCSTEP.RC = 0) THEN
//ELSE01 ELSE
//CHECK EXEC PGM=IDCAMS
//IN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=member,DISP=SHR
//ENDIF01 ENDIF
member contains:
PRINT INFILE (IN) COUNT (1)
IF LASTCC NE 0 THEN SET MAXCC = 13
|
Then the calling job is eg.:
Code: |
.....
STEPA EXEC PROC1
COPYA EXEC PGM=ICEGENER,COND=(13,EQ,STEPA.CHECK)
STEPB EXEC PROC1
COPYB EXEC PGM=ICEGENER,COND=(13,EQ,STEPB.CHECK)
|
Meaning that the copy operation should only be performed if CHECK didn't return RC=13. However, the IF condition of PROC1 only works correctly for the first pass (STEPA), then if the CHECK CC of STEPB should be different, it still catches the result from STEPA. Does anyone know if there's a solution to this? |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Quote: |
however I'd like to get my solution to work |
Good luck with that. Trying to get a poor solution to work, is not worth it to me. |
|
Back to top |
|
|
|