The Initiator does the ENQ, not JES. By that time the Converter and Interpreter have already run. The condition code is unknown until the job actually runs, far too late for the Converter to examine it. The issue transcends the ENQ.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List [[email protected]] on behalf of Hobart Spitz [[email protected]] Sent: Friday, January 7, 2022 1:09 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 I think it's worth mentioning that the reason that SET must be unconditional is that JES has to issue ENQs after, AFAIK, the initial JCL scan and before execution starts. If a dataset has an embedded symbolic, doing the correct ENQ when the value might change at execution time could cause all kinds of problems, not the least of which is not ENQing on the intended data set name. REXX is the new JCL. OREXXMan Would you rather pass data in move mode (*nix piping) or locate mode (Pipes) or via disk (JCL)? Why do you think you rarely see *nix commands with more than a dozen filters, while Pipelines specifications are commonly over 100s of stages, and 1000s of stages are not uncommon. REXX is the new C. On Fri, Jan 7, 2022 at 11:50 AM Paul Gilmartin < [email protected]> wrote: > 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 ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
