Why not simply make Part B and Part C, separate jobs and use IEBGENER to submit 
them to the internal reader based on condition code?   If they can't reside in 
a PDS, then make them instream data to be passed to the IEBGENER based on 
return code.

Adam

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Elardus Engelbrecht
Sent: Wednesday, January 31, 2018 5:11 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Problem with JCL

Ward Able, Grant wrote:

>I have a situation where I need to execute a single JCL procedure, but ONLY 
>execute some steps (including the DSN allocations) for part B or part C, 
>depending on the return code of part A. The problem I seem to be stuck with is 
>that in part B (STEP10 below) I have some datasets defined in the JCL with 
>UNIT=SYSDA and VOL=SER=XXXXXX. However, if STEPA.RC is not 12, then we are not 
>executing in an environment where VOL=SER=XXXXXX is available/mounted. I have 
>been told that I need to have this whole job as a single unit, so it can 
>execute in the different environments as necessary.

Ouch.... that is a hard ugly one.

Split up your jobs in separate jobs or try dynamic, but conditional allocations?

Or insert steps to check for dsn, like this Clist example in a IKJEFT step:

PROC 0                                   
  IF &SYSDSN('???.JCL') = OK THEN   +
   DO                                    
    WRITE DATASET FOUND                  
    SET &RC = 0                          
   END                                   
  ELSE  +                                
   DO                                    
    WRITE DATA SET NOT FOUND             
    SET &RC = 4                          
   END                                   

Use that RC to do your IF checking...


>Is this feasible? Can it be achieved,

Perhaps if there is a way to check the status of a VOLSER in a batch job.

Good luck. If I were you, I had given that assignment to some young 
programmer... ;-)

Groete / Greetings
Elardus Engelbrecht

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to