Re: JCL IF-THEN-ELSE-ENDIF Re: ... Re: Top 8 Reasons for using Python instead of REXX for z/OS

2022-01-07 Thread Paul Gilmartin
On Fri, 7 Jan 2022 20:30:03 +, Seymour J Metz wrote:

>> 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.
> 
Options, compatibility or otherwise, geometrically multiply the testing
burden for software suppliers.

-- gil

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


Re: JCL IF-THEN-ELSE-ENDIF Re: ... Re: Top 8 Reasons for using Python instead of REXX for z/OS

2022-01-07 Thread Seymour J Metz
> 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 [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Paul Gilmartin [000433f07816-dmarc-requ...@listserv.ua.edu]
Sent: Friday, January 7, 2022 12:50 PM
To: IBM-MAIN@LISTSERV.UA.EDU
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 +, 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 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


Re: JCL IF-THEN-ELSE-ENDIF Re: ... Re: Top 8 Reasons for using Python instead of REXX for z/OS

2022-01-07 Thread Seymour J Metz
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 [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Hobart Spitz [orexx...@gmail.com]
Sent: Friday, January 7, 2022 1:09 PM
To: IBM-MAIN@LISTSERV.UA.EDU
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 <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Fri, 7 Jan 2022 04:29:52 +, 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 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

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


Re: JCL IF-THEN-ELSE-ENDIF Re: ... Re: Top 8 Reasons for using Python instead of REXX for z/OS

2022-01-07 Thread Hobart Spitz
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 <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Fri, 7 Jan 2022 04:29:52 +, 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 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


Re: JCL IF-THEN-ELSE-ENDIF Re: ... Re: Top 8 Reasons for using Python instead of REXX for z/OS

2022-01-07 Thread Paul Gilmartin
On Fri, 7 Jan 2022 04:29:52 +, 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: JCL IF-THEN-ELSE-ENDIF Re: ... Re: Top 8 Reasons for using Python instead of REXX for z/OS

2022-01-06 Thread Charles Mills
Yeah, IF is EXEC COND in a different suit of clothes. It must control an entire 
jobstep. :-(

Charles


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Nash, Jonathan S.
Sent: Thursday, January 6, 2022 8:30 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: JCL IF-THEN-ELSE-ENDIF Re: ... Re: Top 8 Reasons for using Python 
instead of REXX for z/OS


Its funny you should mention that now. 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 . 

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

too bad...

It would be nice the other way...

 

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Andrew Rowley
Sent: Thursday, January 06, 2022 10:06 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: [EXTERNAL] Re: ... Re: Top 8 Reasons for using Python instead of REXX 
for z/OS

On 7/01/2022 12:23 pm, David Crayford wrote:
>
> I understand that it's declarative. But it has logic such as IF/THEN. 
> That is no reason why it couldn't have been a scripting language like 
> CL on AS/400.
>
IF/THEN was a late addition, and is probably one of the biggest problems 
with JCL because it doesn't work like IF/THEN in a programming language. 
IF/THEN is really a property of the enclosed steps (I suspect it 
generates the same thing as equivalent COND statements on the steps) 
rather than a logical block in the JCL.

e.g. from the JCL reference:

The system processes the following statements regardless of the logic of 
the IF/THEN/ELSE/ENDIF
statement construct. They can be placed in a THEN or ELSE clause, but 
they are not executed
conditionally.
• PROC and PEND statements
• JES2 and JES3 statements and commands
• JCL command statements
• Comment (//*) statements
• INCLUDE statements
• Delimiter (/*) statements
• Null statements
• SET statements

The IF/THEN/ELSE/ENDIF statement construct does not conditionally 
control the processing of JCL; rather, it conditionally controls the 
execution of job steps.


-- 
Andrew Rowley
Black Hill Software

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

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


JCL IF-THEN-ELSE-ENDIF Re: ... Re: Top 8 Reasons for using Python instead of REXX for z/OS

2022-01-06 Thread Nash, Jonathan S.

Its funny you should mention that now. 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 . 

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

too bad...

It would be nice the other way...

 

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Andrew Rowley
Sent: Thursday, January 06, 2022 10:06 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: [EXTERNAL] Re: ... Re: Top 8 Reasons for using Python instead of REXX 
for z/OS

On 7/01/2022 12:23 pm, David Crayford wrote:
>
> I understand that it's declarative. But it has logic such as IF/THEN. 
> That is no reason why it couldn't have been a scripting language like 
> CL on AS/400.
>
IF/THEN was a late addition, and is probably one of the biggest problems 
with JCL because it doesn't work like IF/THEN in a programming language. 
IF/THEN is really a property of the enclosed steps (I suspect it 
generates the same thing as equivalent COND statements on the steps) 
rather than a logical block in the JCL.

e.g. from the JCL reference:

The system processes the following statements regardless of the logic of 
the IF/THEN/ELSE/ENDIF
statement construct. They can be placed in a THEN or ELSE clause, but 
they are not executed
conditionally.
• PROC and PEND statements
• JES2 and JES3 statements and commands
• JCL command statements
• Comment (//*) statements
• INCLUDE statements
• Delimiter (/*) statements
• Null statements
• SET statements

The IF/THEN/ELSE/ENDIF statement construct does not conditionally 
control the processing of JCL; rather, it conditionally controls the 
execution of job steps.


-- 
Andrew Rowley
Black Hill Software

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