> Would it be a favor to programmers to make misiplacing IF, etc.
> within a job step, or SET within IF ... ENDIF a syntax error?  The
> effect is probably not what the programmers intend.

IMHO, the current behavior is a bug, but it might take an RFE to get it fixed, 
and IBM might add a compatibility option for installations that depend on the 
old behavior. It should at least generate a warning.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Paul Gilmartin [[email protected]]
Sent: Friday, January 7, 2022 12:50 PM
To: [email protected]
Subject: Re: JCL IF-THEN-ELSE-ENDIF Re: ... Re: Top 8 Reasons for using Python 
instead of REXX for z/OS

On Fri, 7 Jan 2022 04:29:52 +0000, Nash, Jonathan S. wrote:
>
>    ... I was just
>working on some JCL and I had just assumed that I
>could set symbolics using IF THEN ELSE ENDIF:
>
>// IF (STEP1.RC = 0) THEN
>//  SYMB=GOOD
>// ELSE
>//  SYMB=BAD
>// ENDIF
>
>but I found out that BOTH SET statements are executed
>no matter what the return code is .
>
Even as in assembler it doesn't work to BC bypassing a SETC.  The JCL
Ref. is perhaps to specific in listing instructions that are not subject
to IF ... ENDIF rather than describing which control the Converter and
which control the Initiator.

>It also appears to me that I cannot put just one DD
>within an IF statement. It looks an entire step has
>to be in there... I think...
>
And it's truly confusing that if a DD statement is in a step bypassed
by IF (or COND=) allocation, deletion, or cataloging is not performed
but the ENQ SYSDSN is still issued.

Would it be a favor to programmers to make misiplacing IF, etc.
within a job step, or SET within IF ... ENDIF a syntax error?  The
effect is probably not what the programmers intend.

-- 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

Reply via email to