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
 

 

COND referback in nested PROCS?

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

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Thu May 15, 2014 6:34 pm    Post subject: COND referback in nested PROCS?
Reply with quote

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
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu May 15, 2014 9:22 pm    Post subject:
Reply with quote

Yes.
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Mon May 19, 2014 12:57 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1714
Location: UK

PostPosted: Mon May 19, 2014 1:29 pm    Post subject: Reply to: COND referback in nested PROCS?
Reply with quote

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
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Mon May 19, 2014 2:07 pm    Post subject:
Reply with quote

I believe the answer is NO as well.. However, I really wanted it to be YES icon_smile.gif Thanks anyways.

Claes
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Mon May 19, 2014 2:58 pm    Post subject: Reply to: COND referback in nested PROCS?
Reply with quote

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
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Mon May 19, 2014 3:10 pm    Post subject:
Reply with quote

Bill, I see what you're getting at icon_smile.gif 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! icon_smile.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1714
Location: UK

PostPosted: Mon May 19, 2014 6:19 pm    Post subject: Reply to: COND referback in nested PROCS?
Reply with quote

Include your ICEGENER in PROC1?
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Mon May 19, 2014 6:35 pm    Post subject:
Reply with quote

That would be a good solution, if only PROC1 weren't used throughout our system. icon_smile.gif 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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Mon May 19, 2014 6:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Mon May 19, 2014 7:51 pm    Post subject:
Reply with quote

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" icon_sad.gif 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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Mon May 19, 2014 8:24 pm    Post subject:
Reply with quote

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
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
No new posts IEF645I INVALID REFERBACK IN THE RC ... abdulrafi JCL & VSAM 2 Mon Aug 29, 2016 10:57 am
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts COND parameter vs IF THEN ELSE Alks JCL & VSAM 11 Fri Jun 17, 2016 5:28 pm
No new posts Include Cond issue vickey_dw DFSORT/ICETOOL 6 Tue Mar 29, 2016 8:51 pm
No new posts Referback the DCB of SORTIN while usi... venksiv CLIST & REXX 7 Tue Mar 15, 2016 5:47 pm


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