Gil:
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
My rexx routine:
/*-- Rexx */
arg argsin
say 'SETRC invoked at date: 'date(u)' 'time()
call parse_args;
exit(rcc);
parse_args:
/*-----------------------------------*/
/* parse routine for arguments */
/* func = BUILD,COPY,XMIT,DELETE */
/* return is set to 1 if */
/* func=delete */
/* return is set to 3 if */
/* func=delete,build */
/* return is set to 4 if */
/* func=build,copy */
/* return is set to 5 if */
/* func=delete,build,copy */
/* return is set to 7 if */
/* func=delete,build,copy,xmit */
/* return is set to 9 if */
/* func=archive,delete */
/*-----------------------------------*/
x = 0;
rcc = 0;
argstring = translate(argsin,' ',',')
if wordpos('DELETE',argstring) > 0 then do
rcc = 1
say 'Delete Found'
end
if wordpos('ARCHIVE',argstring) > 0 then do
rcc = rcc + 8
say 'Delete Found'
end
if wordpos('BUILD',argstring) > 0 then do
rcc = rcc + 2
say 'Build Found'
end
if wordpos('COPY',argstring) > 0 then do
rcc = rcc + 2
say 'Copy Found'
end
if wordpos('XMIT',argstring) > 0 then do
rcc = rcc + 2
say 'Xmit Found'
end
return(rcc);
Feel free to use ...
On Fri, Feb 17, 2017 at 7:24 PM, Paul Gilmartin <
[email protected]> wrote:
> On Fri, 17 Feb 2017 13:16:40 -0600, John McKown wrote:
>
> >On Fri, Feb 17, 2017 at 1:03 PM, George, William wrote:
> >
> >> The JCL below
> >> 1. Sets symbolic &SFX = "A"
> >> 2. checks if a dataset exists,
> >> 3. if it does exist it changes the symbolic &SFX = "B"
> >> 4. for the dataset used in the Step3.
> >>
> >> However, processing ALWAYS falls into the THEN path even when the RC =
> 0.
> >> What am I missing?
> >> Note: this is just test JCL to verify the changing of the &SFX symbolic
> works.
> >> Thanks for any insights!
> >>
> >
> >// SET statements are _always_ processed, regardless of any // IF
> >condition.
> >ref:
> >https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/
> com.ibm.zos.v2r2.ieab600/iea3b6_Considerations_for_
> using_the_SET_statement.htm
> >
> A better way to understand this is that symbols are SET and resolved
> by the reader process, long before your job begins execution.
>
> You need to replicate the following job step(s) in both the THEN and
> ELSE clauses with the trivial difference in the suffix.
>
> Or, do the whole thing in Rexx.
>
> I think the designers of JCL believed that any programmer
> who doesn't know a priori whether his data set exists is using
> an out-of-control process.
>
> -- gil
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN