If the issue is to use FileA if it exists, otherwise use FileB, the maybe
the best answer is to create a new file that is input to the STEP3 process.
You can do all this in the IDCAMS with something like this (untested),
where you define the temporary file (TEMPDD) in the JCL. This will also set
the CC for the step to either 1 or 2 to show which file was used, in case
you want to do something later on (you could then test If stepname.CC.RUN
and stepname.CC EQ 1...).
Note that to do this right, you should also Listcat FileB to be sure it is
there if FileA is not...I will leave that exercise up to the reader. :)
Billy
//SYSIN DD *
LISTCAT ENTRIES('Q6498.BIND.ENTLISTA')
IF LASTCC = 0 THEN -
DO
REPRO IDS('Q6498.BIND.ENTLISTA') -
OFILE(TempDD)
SET MAXCC=1
END
ELSE -
DO
REPRO IDS('Q6498.BIND.ENTLISTB') -
OFILE(TempDD)
SET MAXCC=2
END
/*
On Tue, Feb 21, 2017 at 10:40 AM, George, William@FTB <
[email protected]> wrote:
> Thanks for the suggestions.
> Yes, I definitely, and easily, could do this with a REXX however.... :-(
>
>
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On
> Behalf Of scott Ford
> Sent: Saturday, February 18, 2017 8:15 AM
> To: [email protected]
> Subject: Re: JCL IF Condition - I'm Missing Something
>
> Gil,
>
> Yeah, I hear you, it should be simpler to perform tasks.
>
>
>
> On Sat, Feb 18, 2017 at 11:12 AM Paul Gilmartin < 0000000433f07816-dmarc-
> [email protected]> wrote:
>
> > On Fri, 17 Feb 2017 21:44:01 -0500, scott Ford wrote:
> >
> > >
> >
> > >Heres what I did:
> >
> > >
> >
> > >//BUILDLIB JOB SYSTEMS,MSGLEVEL=(1,1),MSGCLASS=X,CLASS=A,PRTY=8,
> >
> > >// NOTIFY=&SYSUID,REGION=4096K
> >
> > >//*------------------------------------------*
> >
> > >//* BUILD IDF-TSS PRODUCT LIBRARIES *
> >
> > >//*------------------------------------------*
> >
> > >//MYLIBS JCLLIB ORDER=IDF.PRODCTL.JCLLIB
> >
> > >//MYSETS INCLUDE MEMBER=JCLSETS
> >
> > >//*-------------------------------------------------------*
> >
> > >//* REXX INITIAL STEP TO SET RC FOR IDF *
> >
> > >//*-------------------------------------------------------*
> >
> > >//STEP1 EXEC PGM=IRXJCL,PARM='SETRC BUILD,COPY'
> >
> > >//SYSEXEC DD DSN=IDF.PRODCLST.LIBRARY,DISP=SHR
> >
> > >//SYSTSPRT DD SYSOUT=*
> >
> > >//REXXLOG DD SYSOUT=*
> >
> > >//SYSPRINT DD SYSOUT=*
> >
> > >//SYSTSIN DD DUMMY
> >
> > >//IF1 IF (STEP1.RC = 4) THEN
> >
> > >//MYBUILD INCLUDE MEMBER=LIBUILD
> >
> > >//ENDIF1 ENDIF
> >
> > >//IF1 IF (STEP2.RC = 0) THEN
> >
> > >//MYCPY INCLUDE MEMBER=CPYLIBS
> >
> > >//ENDIF1 ENDIF
> >
> > >
> >
> > Yes, but be aware that:
> >
> >
> >
> > o ENQues for data set names mentioned in either MYBUILD or MYCPY
> >
> > will be issued, regardless that only one of those steps will be
> executed.
> >
> >
> >
> > o JES3 setup adds constraints. For example if the same data set is
> >
> > mentioned with DISP=(,CATLG) in both MYBUILD and MYCPY JES3
> >
> > setup will report a conflict because it assumes all steps will be
> >
> > executed regardless of IF or COND.
> >
> >
> >
> > I hate JCL!
> >
> >
> >
> > -- gil
> >
> >
> >
> > ----------------------------------------------------------------------
> >
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> >
> > send email to [email protected] with the message: INFO IBM-MAIN
> >
> > --
> Scott Ford
> IDMWORKS
> z/OS Development
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send email
> to [email protected] with the message: INFO IBM-MAIN
>
> ______________________________________________________________________
> CONFIDENTIALITY NOTICE: This email from the State of California is for the
> sole use of the intended recipient and may contain confidential and
> privileged information. Any unauthorized review or use, including
> disclosure or distribution, is prohibited. If you are not the intended
> recipient, please contact the sender and destroy all copies of this email.
>
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
--
Thank you and best regards,
*Billy Ashton*
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN