Re: JCL IF Condition - I'm Missing Something

2017-02-22 Thread CM Poncelet
and ...
> //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=*
> //SYSTSINDD DUMMY
> //*
> //STEP1A  EXEC PGM=WHATEVER,COND=(04,NE,STEP1)
> //* IFF 4 is NE to the return code from STEP1 THEN Bypass this step
> //*
> //STEP1B  EXEC PGM=WHATEVER,COND=(00,NE,STEP1)
> //* IFF 0 is NE to the return code from STEP1 THEN Bypass this step
...
> //STEP1C EXEC PGM=IEFBR14,COND=(00,LE,STEP1)
> //* IFF STEP1 has executed THEN Bypass this step
> //STEP1D EXEC PGM=WHATEVER,COND=(00,LE,STEP1C)
> //* IFF STEP1 has NOT executed THEN Bypass this step
... for the Boolean Logic part

On 22/02/2017 17:26, John Mattson wrote:

> //* 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=*
> //SYSTSINDD DUMMY
> //*
> //STEP1A  EXEC PGM=WHATEVER,COND=(04,NE,STEP1)
> //* IFF 4 is NE to the return code from STEP1 THEN Bypass this step
> //*
> //STEP1B  EXEC PGM=WHATEVER,COND=(00,NE,STEP1)
> //* IFF 0 is NE to the return code from STEP1 THEN Bypass this step
> 
> It helps if you have some knowledge of Boolean Logic which should be taught
> in programming schools but often no longer is.
> Also, note that if the RC from STEP1 is 2 or 6, or anything other than 0 or
> 4, then NEITHER step will execute and the job will finish with a good
> return code, but really fail.   There SHOULD be another test, basic
> programming, test for ALL possible conditions whenever possible.
> //STEP1C  EXEC PGM=ABENDNOW,COND=((04,NE,STEP1),(00,NE,STEP1))
> //* IFF 4 is NE to the return code from STEP1 AND 0 NE  THEN ABEND NOW!!!
> 
> --
> 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 Condition - I'm Missing Something

2017-02-22 Thread Steve Smith
The big problem with the old COND= operand (IMHO) is that it works
backwards from normal logic.  It was really hard for me to integrate into
my hard head that you are specifying the COND for *not* executing the
step.  Add a NE, and my brain melts down.

// IF is an improvement, but it implies that JCL is a procedural language;
and it is not.  See previous discussions of // SET.

sas

On Wed, Feb 22, 2017 at 4:13 PM, John McKown 
wrote:

> On Wed, Feb 22, 2017 at 2:32 PM, Greg Dyck  wrote:
>
> > On 2/22/2017 2:19 PM, John McKown wrote:
> >
> >> ​But I agree that // ELSIF or // ELSEIF would be superior. DEFAULT /
> >> OTHERWISE is simply after the last ELSE. Perhaps instead of // IF, IBM
> >> should have have // CASE?
> >>
> >
> > Ahhh, but will your company *pay* IBM more $$ for z/OS if this
> > functionality were provided?
> >
>
> ​[reverting to old fart mode] Ahhh, but if IBM hadn't locked up the source
> (aka OCO), then the advanced users wouldn't _have_ to pay IBM for the
> functionality because they could add it themselves! Or at least better
> understand why it is not possible beyond "it costs too much" or "it is too
> difficult" (aka "IBM doesn't think it will pay off in terms of income.")
> Like most here, I remember that many of the initial enhancements to MVT &
> MVS were from outside of IBM.​
>
>
>
> >
> > I wasn't on the team that implemented this support, but I know that when
> > new function gets implemented there must be a balance between what is
> > possible, what was asked for, what doing it will cost, and what else must
> > be done.  I'm sure it is no different where you work.
> >
>
> Very true! The basic, and reasonable, mantra for _all_ capitalistic
> companies is "Don't do it if it won't result in greater profitability."
> Which is why _I_ am a member of the FSF​ and, on my personal machines, use
> GNU/Linux software. __MOST__ of which is open source (GPL or MIT licensed).
> If I really, really, want it (and have the talent), I can "fork" a software
> project and change it. I can even return my changes to the original
> developers. If they want it, then they can use it. If they don't want it,
> and I'm really sold on it, I simply put my version up on GitHub and
> publicize it. Let the users decide. Case in point: LibreOffice vs
> OpenOffice - though they seem to be rejoining now that OpenOffice is an
> Apache foundation project and not Oracle. Also the MariaDB fork of MySQL -
> again caused by Oracle as I understand it.
>
>
>
> >
> > Given the limited definition for conditional execution that was done 50
> > years ago, I think this support is a big step up.
> >
>
> ​Total agreement on this point. Gil's desire is reasonable, but costly at
> this point. For me, the IBM implementation is definitely appreciated. I can
> actually figure out // IF whereas the old COND= on the EXEC would give me
> headaches ... literally.​
>
>
>
> >
> > Regards,
> > Greg
> >
> >
>
> --
> "Irrigation of the land with seawater desalinated by fusion power is
> ancient. It's called 'rain'." -- Michael McClary, in alt.fusion
>
> Maranatha! <><
> John McKown
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>



-- 
sas

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


Re: JCL IF Condition - I'm Missing Something

2017-02-22 Thread John McKown
On Wed, Feb 22, 2017 at 2:32 PM, Greg Dyck  wrote:

> On 2/22/2017 2:19 PM, John McKown wrote:
>
>> ​But I agree that // ELSIF or // ELSEIF would be superior. DEFAULT /
>> OTHERWISE is simply after the last ELSE. Perhaps instead of // IF, IBM
>> should have have // CASE?
>>
>
> Ahhh, but will your company *pay* IBM more $$ for z/OS if this
> functionality were provided?
>

​[reverting to old fart mode] Ahhh, but if IBM hadn't locked up the source
(aka OCO), then the advanced users wouldn't _have_ to pay IBM for the
functionality because they could add it themselves! Or at least better
understand why it is not possible beyond "it costs too much" or "it is too
difficult" (aka "IBM doesn't think it will pay off in terms of income.")
Like most here, I remember that many of the initial enhancements to MVT &
MVS were from outside of IBM.​



>
> I wasn't on the team that implemented this support, but I know that when
> new function gets implemented there must be a balance between what is
> possible, what was asked for, what doing it will cost, and what else must
> be done.  I'm sure it is no different where you work.
>

Very true! The basic, and reasonable, mantra for _all_ capitalistic
companies is "Don't do it if it won't result in greater profitability."
Which is why _I_ am a member of the FSF​ and, on my personal machines, use
GNU/Linux software. __MOST__ of which is open source (GPL or MIT licensed).
If I really, really, want it (and have the talent), I can "fork" a software
project and change it. I can even return my changes to the original
developers. If they want it, then they can use it. If they don't want it,
and I'm really sold on it, I simply put my version up on GitHub and
publicize it. Let the users decide. Case in point: LibreOffice vs
OpenOffice - though they seem to be rejoining now that OpenOffice is an
Apache foundation project and not Oracle. Also the MariaDB fork of MySQL -
again caused by Oracle as I understand it.



>
> Given the limited definition for conditional execution that was done 50
> years ago, I think this support is a big step up.
>

​Total agreement on this point. Gil's desire is reasonable, but costly at
this point. For me, the IBM implementation is definitely appreciated. I can
actually figure out // IF whereas the old COND= on the EXEC would give me
headaches ... literally.​



>
> Regards,
> Greg
>
>

-- 
"Irrigation of the land with seawater desalinated by fusion power is
ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

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


Re: JCL IF Condition - I'm Missing Something

2017-02-22 Thread Paul Gilmartin
On Wed, 22 Feb 2017 14:20:10 -0600, John McKown wrote:
>> >
>> No.  Where would you code the DEFAULT/OTHERWISE clause?
>​
>>//IF1  IF ...
>...
>//   ELSE
>//IF2  IF
>...
>//ELSE
>//IF3  IF
>...
>​//OTHRWISE​ ELSE
>​...
>//ENDIF3 ENDIF
>//ENDIF2 ENDIF
>//ENDIF2 ENDIR​
> 
Still no.  The OTHERWISE clause is not performed if either IF1 or IF2 is false;
only if both IF1 and IF2 are true and IF3 is false.

>​But I agree that // ELSIF or // ELSEIF would be superior. DEFAULT /
>OTHERWISE is simply after the last ELSE. Perhaps instead of // IF, IBM
>should have have // CASE?
>
>//SETRC EXEC PGM=SOMEPGM
>//CHKRC  CASE
>// WHEN RC=0 THEN
>...
>// WHEN RC=4 THEN
>..
>// DEFAULT
>...
>// ENDCASE​ CHKRC
> 
Yup.  The Rexx SELECT is merely a string of ELSEIFs.

>Where the CHKRC on the // ENDCASE is actually checked to match the label on
>the previous // CASE .

-- 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 Condition - I'm Missing Something

2017-02-22 Thread Greg Dyck

On 2/22/2017 2:19 PM, John McKown wrote:

​But I agree that // ELSIF or // ELSEIF would be superior. DEFAULT /
OTHERWISE is simply after the last ELSE. Perhaps instead of // IF, IBM
should have have // CASE?


Ahhh, but will your company *pay* IBM more $$ for z/OS if this 
functionality were provided?


I wasn't on the team that implemented this support, but I know that when 
new function gets implemented there must be a balance between what is 
possible, what was asked for, what doing it will cost, and what else 
must be done.  I'm sure it is no different where you work.


Given the limited definition for conditional execution that was done 50 
years ago, I think this support is a big step up.


Regards,
Greg

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


Re: JCL IF Condition - I'm Missing Something

2017-02-22 Thread John McKown
On Wed, Feb 22, 2017 at 1:36 PM, Paul Gilmartin <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Wed, 22 Feb 2017 12:43:19 -0600, John McKown wrote:
> >
> >> If only the designers (excuse me; perpetrators) of JCL had thought to
> >> provide an ELSEIF statement, they could have much simplified this
> >> (What century were they trained in?):
> >
> >​I can't answer that, but it could be argued that it is not __absolutely__
> >necessary since the other constructs can emulate it, albeit ​clumsily
> >
> ​​
> >//IF1  IF ...
> >...
> >//   ELSE
> >//IF2  IF
> >...
> >//ELSE
> >//IF3  IF
> >...
> >//ENDIF3 ENDIF
> >//ENDIF2 ENDIF
> >//ENDIF1 ENDIF
> >
> No.  Where would you code the DEFAULT/OTHERWISE clause?
>

​
>//IF1  IF ...
...
//   ELSE
//IF2  IF
...
//ELSE
//IF3  IF
...
​//OTHRWISE​ ELSE
​...
//ENDIF3 ENDIF
//ENDIF2 ENDIF
//ENDIF2 ENDIR​

​But I agree that // ELSIF or // ELSEIF would be superior. DEFAULT /
OTHERWISE is simply after the last ELSE. Perhaps instead of // IF, IBM
should have have // CASE?

//SETRC EXEC PGM=SOMEPGM
//CHKRC  CASE
// WHEN RC=0 THEN
...
// WHEN RC=4 THEN
..
// DEFAULT
...
// ENDCASE​ CHKRC

Where the CHKRC on the // ENDCASE is actually checked to match the label on
the previous // CASE .



>
> And they missed an opportunity to provide far better error
> checking by failing to require that label fields on corresponding
> IF, THEN, ELSE, and ENDIF match.
>

​Total agreement. ​


>
> -- gil
>
>
-- 
"Irrigation of the land with seawater desalinated by fusion power is
ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

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


Re: JCL IF Condition - I'm Missing Something

2017-02-22 Thread Paul Gilmartin
On Wed, 22 Feb 2017 12:43:19 -0600, John McKown wrote:
>
>> If only the designers (excuse me; perpetrators) of JCL had thought to
>> provide an ELSEIF statement, they could have much simplified this
>> (What century were they trained in?):
>
>​I can't answer that, but it could be argued that it is not __absolutely__
>necessary since the other constructs can emulate it, albeit ​clumsily
>
>//IF1  IF ...
>...
>//   ELSE
>//IF2  IF
>...
>//ELSE
>//IF3  IF
>...
>//ENDIF3 ENDIF
>//ENDIF2 ENDIF
>//ENDIF1 ENDIF
>
No.  Where would you code the DEFAULT/OTHERWISE clause?

And they missed an opportunity to provide far better error
checking by failing to require that label fields on corresponding
IF, THEN, ELSE, and ENDIF match.

-- 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 Condition - I'm Missing Something

2017-02-22 Thread John McKown
On Wed, Feb 22, 2017 at 12:32 PM, Paul Gilmartin <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Wed, 22 Feb 2017 09:26:58 -0800, John Mattson wrote:
>
> >Mr Poncelet is correct here.  While the old fashioned COND statements had
> a
> >funky syntax, there are some cases where they just work simpler.
> >See my example, below, which also presents a reasonable way to make sense
> >of the old syntax.
> >...
> >//STEP1A  EXEC PGM=WHATEVER,COND=(04,NE,STEP1)
> >//* IFF 4 is NE to the return code from STEP1 THEN Bypass this step
> >//*
> >//STEP1B  EXEC PGM=WHATEVER,COND=(00,NE,STEP1)
> >//* IFF 0 is NE to the return code from STEP1 THEN Bypass this step
> >
> > ...   There SHOULD be another test, basic
> >programming, test for ALL possible conditions whenever possible.
> >
> If only the designers (excuse me; perpetrators) of JCL had thought to
> provide an ELSEIF statement, they could have much simplified this
> (What century were they trained in?):
>

​I can't answer that, but it could be argued that it is not __absolutely__
necessary since the other constructs can emulate it, albeit ​clumsily

//IF1  IF ...
...
//   ELSE
//IF2  IF
...
//ELSE
//IF3  IF
...
//ENDIF3 ENDIF
//ENDIF2 ENDIF
//ENDIF1 ENDIF



>
> //  IF (STEP1.COND EQ 4 ) THEN
> >//* IFF 4 is EQ to the return code from STEP1 THEN perform this step
> //*
> //  ELSEIF (STEP1.COND EQ 00) THEN
> //* IFF 0 is EQ to the return code from STEP1 THEN perform this step
> //*
> //  ELSE
> //* Handle unexpected RC in this step.
> //  ENDIF
>
> I hate JCL!
>

​I'm not a great fan of it myself. Of course, for some things I have
abandoned it for doing things using a REXX script (UNIX or TSO, depending)
or a UNIX shell, via Co:Z batch launcher.​ The main reason that I still use
JCL is CA-7 restart. I am not aware of _anything_ on the market which can
do something similar to this function for a REXX script or a UNIX shell
script. They need to be written with restart in mind at the application
level.



>
> RFE, anyone?
>
> -- gil
>
>

-- 
"Irrigation of the land with seawater desalinated by fusion power is
ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

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


Re: JCL IF Condition - I'm Missing Something

2017-02-22 Thread Paul Gilmartin
On Wed, 22 Feb 2017 09:26:58 -0800, John Mattson wrote:

>Mr Poncelet is correct here.  While the old fashioned COND statements had a
>funky syntax, there are some cases where they just work simpler.
>See my example, below, which also presents a reasonable way to make sense
>of the old syntax.
>...
>//STEP1A  EXEC PGM=WHATEVER,COND=(04,NE,STEP1)
>//* IFF 4 is NE to the return code from STEP1 THEN Bypass this step
>//*
>//STEP1B  EXEC PGM=WHATEVER,COND=(00,NE,STEP1)
>//* IFF 0 is NE to the return code from STEP1 THEN Bypass this step
>
> ...   There SHOULD be another test, basic
>programming, test for ALL possible conditions whenever possible.
>
If only the designers (excuse me; perpetrators) of JCL had thought to
provide an ELSEIF statement, they could have much simplified this
(What century were they trained in?):

//  IF (STEP1.COND EQ 4 ) THEN
>//* IFF 4 is EQ to the return code from STEP1 THEN perform this step
//*
//  ELSEIF (STEP1.COND EQ 00) THEN
//* IFF 0 is EQ to the return code from STEP1 THEN perform this step
//*
//  ELSE
//* Handle unexpected RC in this step.
//  ENDIF

I hate JCL!

RFE, anyone?

-- 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 Condition - I'm Missing Something

2017-02-22 Thread John Mattson
Mr Poncelet is correct here.  While the old fashioned COND statements had a
funky syntax, there are some cases where they just work simpler.
See my example, below, which also presents a reasonable way to make sense
of the old syntax.

> From:CM Poncelet 
> If you want the original JCL COND= parms to fix this (instead of the
> 'JCL for Dummies' IF THEN ELSE), let me know. Cheers, CP

//* 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=*
//SYSTSINDD DUMMY
//*
//STEP1A  EXEC PGM=WHATEVER,COND=(04,NE,STEP1)
//* IFF 4 is NE to the return code from STEP1 THEN Bypass this step
//*
//STEP1B  EXEC PGM=WHATEVER,COND=(00,NE,STEP1)
//* IFF 0 is NE to the return code from STEP1 THEN Bypass this step

It helps if you have some knowledge of Boolean Logic which should be taught
in programming schools but often no longer is.
Also, note that if the RC from STEP1 is 2 or 6, or anything other than 0 or
4, then NEITHER step will execute and the job will finish with a good
return code, but really fail.   There SHOULD be another test, basic
programming, test for ALL possible conditions whenever possible.
//STEP1C  EXEC PGM=ABENDNOW,COND=((04,NE,STEP1),(00,NE,STEP1))
//* IFF 4 is NE to the return code from STEP1 AND 0 NE  THEN ABEND NOW!!!

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


Re: JCL IF Condition - I'm Missing Something

2017-02-21 Thread CM Poncelet
If you want the original JCL COND= parms to fix this (instead of the
'JCL for Dummies' IF THEN ELSE), let me know. Cheers, CP


On 21/02/2017 15:40, George, William@FTB 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:IBM-MAIN@LISTSERV.UA.EDU] On 
> Behalf Of scott Ford
> Sent: Saturday, February 18, 2017 8:15 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> 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 < 
> 000433f07816-dmarc-requ...@listserv.ua.edu> 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=,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
>>
>>> //MYCPYINCLUDE 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>
>> --
> Scott Ford
> IDMWORKS
> z/OS Development
> 
> --
> For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
> lists...@listserv.ua.edu 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 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 Condition - I'm Missing Something

2017-02-21 Thread Bill Ashton
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 <
bill.geo...@ftb.ca.gov> 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:IBM-MAIN@LISTSERV.UA.EDU] On
> Behalf Of scott Ford
> Sent: Saturday, February 18, 2017 8:15 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> 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 < 000433f07816-dmarc-
> requ...@listserv.ua.edu> 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=,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
> >
> > >//MYCPYINCLUDE 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >
> > --
> Scott Ford
> IDMWORKS
> z/OS Development
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions, send email
> to lists...@listserv.ua.edu 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>



-- 
Thank you and best regards,
*Billy Ashton*

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


Re: JCL IF Condition - I'm Missing Something

2017-02-21 Thread George, William@FTB
Thanks for the suggestions.
Yes, I definitely, and easily, could do this with a REXX however  :-(


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of scott Ford
Sent: Saturday, February 18, 2017 8:15 AM
To: IBM-MAIN@LISTSERV.UA.EDU
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 < 
000433f07816-dmarc-requ...@listserv.ua.edu> 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=,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
>
> >//MYCPYINCLUDE 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
Scott Ford
IDMWORKS
z/OS Development

--
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: JCL IF Condition - I'm Missing Something

2017-02-18 Thread scott Ford
Gil,

Yeah, I hear you, it should be simpler to perform tasks.



On Sat, Feb 18, 2017 at 11:12 AM Paul Gilmartin <
000433f07816-dmarc-requ...@listserv.ua.edu> 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=,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
>
> >//MYCPYINCLUDE 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
Scott Ford
IDMWORKS
z/OS Development

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


Re: JCL IF Condition - I'm Missing Something

2017-02-18 Thread Paul Gilmartin
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=,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
>//MYCPYINCLUDE 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: JCL IF Condition - I'm Missing Something

2017-02-17 Thread scott Ford
Gil:

Heres what I did:

//BUILDLIB JOB SYSTEMS,MSGLEVEL=(1,1),MSGCLASS=X,CLASS=A,PRTY=8,
// NOTIFY=,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
//MYCPYINCLUDE 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 <
000433f07816-dmarc-requ...@listserv.ua.edu> 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  = "A"
> >> 2.   checks if a dataset exists,
> >> 3.   if it does exist it changes the symbolic  = "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  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 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 Condition - I'm Missing Something

2017-02-17 Thread Paul Gilmartin
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  = "A"
>> 2.   checks if a dataset exists,
>> 3.   if it does exist it changes the symbolic  = "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  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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: JCL IF Condition - I'm Missing Something

2017-02-17 Thread J R
Did you mean RC > 0  ?

Sent from my iPhone

> On Feb 17, 2017, at 14:29, Hardee, Chuck <chuck.har...@thermofisher.com> 
> wrote:
> 
> William,
> 
> Here's a modified version of your test without SETs:
> 
> //* 
> //CKEXIST1 EXEC PGM=IDCAMS  
> //SYSPRINT DD SYSOUT=*  
> //SYSINDD * 
>   LISTCAT ENTRIES('S01CH.TEST.LOADLIB')
> /*  
> //CHECKIF1 IF CKEXIST1.RC < 4 THEN  
> //IFEXECED EXEC PGM=IEFBR14 
> //CHECKIF1 ENDIF
> //* 
> //CKEXIST2 EXEC PGM=IDCAMS  
> //SYSPRINT DD SYSOUT=*  
> //SYSINDD * 
>   LISTCAT ENTRIES('S01CH.TEST.NO.LOADLIB') 
> /*  
> //CHECKIF2 IF CKEXIST2.RC < 4 THEN  
> //IFEXECED EXEC PGM=IEFBR14 
> //CHECKIF2 ENDIF
> //* 
> 
> And the results:
> -STEPNAME PROCSTEPRC 
> -CKEXIST1 00 
> -IFEXECED 00 
> -CKEXIST2 04 
> -IFEXECED  FLUSH 
> IEF404I S01CHIFT - ENDED
> 
> The first dataset exists, the second doesn't.
> 
> Is this what you're trying to accomplish or are you truly wanting variable 
> SETs?
> 
> C-
> 
> 
> 
> Charles (Chuck) Hardee
> Senior Systems Engineer/Database Administration
> EAS Information Technology
> 
> Thermo Fisher Scientific
> 300 Industry Drive | Pittsburgh, PA 15275
> Phone +1 (724) 517-2633 | Mobile +1 (412) 877-2809 | FAX: +1 (412) 490-9230
> chuck.har...@thermofisher.com  | www.thermofisher.com
> 
> WORLDWIDE CONFIDENTIALITY NOTE: Dissemination, distribution or copying of 
> this e-mail or the information herein by anyone other than the intended 
> recipient, or an employee or agent of a system responsible for delivering the 
> message to the intended recipient, is prohibited. If you are not the intended 
> recipient, please inform the sender and delete all copies.
> 
> 
> -Original Message-
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On 
> Behalf Of George, William@FTB
> Sent: Friday, February 17, 2017 2:27 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: JCL IF Condition - I'm Missing Something
> 
> Thanks. I guess I'll have to attack the setting of the suffix differently 
> then.
> 
> 
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On 
> Behalf Of Jim Brooks
> Sent: Friday, February 17, 2017 11:26 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: JCL IF Condition - I'm Missing Something
> 
> The SET statement is not executed conditionally. For example, if the SET 
> statement appears in an IF/THEN/ELSE/ENDIF statement construct, the value is 
> assigned to the symbolic parameter regardless of the logic of the construct.
> 
> Regards,
> Jim
> 
> On Fri, Feb 17, 2017 at 2:03 PM, George, William@FTB <bill.geo...@ftb.ca.gov
>> wrote:
> 
>> The JCL below
>> 
>> 1.   Sets symbolic  = "A"
>> 
>> 2.   checks if a dataset exists,
>> 
>> 3.   if it does exist it changes the symbolic  = "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  
>> symbolic works.
>> Thanks for any insights!
>> Bill
>> 
>> //*
>> //SET1  SET  SFX=A
>> //*
>> //CHKEXIST EXEC PGM=IDCAMS
>> //SYSPRINT DD SYSOUT=*
>> //SYSINDD *
>>   LISTCAT ENTRIES('Q6498.BIND.ENTLISTA')
>> /*
>> //CHECKIF IF CHKEXIST.RC < 4 THEN
>> //SET2   SET SFX=B
>> //CHECKIF ENDIF
>> //*
>> //STEP3EXEC PGM=SORT
>> //SYSOUT   DD SYSOUT=*
>> //SORTIN   DD DISP=SHR,DSN=Q6498.BIND.ENTLIST
>> //SORTOUT  DD DSN=DUMMY
>> //SYSINDD *
>>  SORT FIELDS=COPY
>> //
>> 
>> 
>> __
>> 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 em

Re: JCL IF Condition - I'm Missing Something

2017-02-17 Thread Hardee, Chuck
William,

Here's a modified version of your test without SETs:

//* 
//CKEXIST1 EXEC PGM=IDCAMS  
//SYSPRINT DD SYSOUT=*  
//SYSINDD * 
   LISTCAT ENTRIES('S01CH.TEST.LOADLIB')
/*  
//CHECKIF1 IF CKEXIST1.RC < 4 THEN  
//IFEXECED EXEC PGM=IEFBR14 
//CHECKIF1 ENDIF
//* 
//CKEXIST2 EXEC PGM=IDCAMS  
//SYSPRINT DD SYSOUT=*  
//SYSINDD * 
   LISTCAT ENTRIES('S01CH.TEST.NO.LOADLIB') 
/*  
//CHECKIF2 IF CKEXIST2.RC < 4 THEN  
//IFEXECED EXEC PGM=IEFBR14 
//CHECKIF2 ENDIF
//* 

And the results:
-STEPNAME PROCSTEPRC 
-CKEXIST1 00 
-IFEXECED 00 
-CKEXIST2 04 
-IFEXECED  FLUSH 
IEF404I S01CHIFT - ENDED

The first dataset exists, the second doesn't.

Is this what you're trying to accomplish or are you truly wanting variable SETs?

C-



Charles (Chuck) Hardee
Senior Systems Engineer/Database Administration
EAS Information Technology

Thermo Fisher Scientific
300 Industry Drive | Pittsburgh, PA 15275
Phone +1 (724) 517-2633 | Mobile +1 (412) 877-2809 | FAX: +1 (412) 490-9230
chuck.har...@thermofisher.com  | www.thermofisher.com

WORLDWIDE CONFIDENTIALITY NOTE: Dissemination, distribution or copying of this 
e-mail or the information herein by anyone other than the intended recipient, 
or an employee or agent of a system responsible for delivering the message to 
the intended recipient, is prohibited. If you are not the intended recipient, 
please inform the sender and delete all copies.


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of George, William@FTB
Sent: Friday, February 17, 2017 2:27 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: JCL IF Condition - I'm Missing Something

Thanks. I guess I'll have to attack the setting of the suffix differently then.


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Jim Brooks
Sent: Friday, February 17, 2017 11:26 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: JCL IF Condition - I'm Missing Something

The SET statement is not executed conditionally. For example, if the SET 
statement appears in an IF/THEN/ELSE/ENDIF statement construct, the value is 
assigned to the symbolic parameter regardless of the logic of the construct.

Regards,
Jim

On Fri, Feb 17, 2017 at 2:03 PM, George, William@FTB <bill.geo...@ftb.ca.gov
> wrote:

> The JCL below
>
> 1.   Sets symbolic  = "A"
>
> 2.   checks if a dataset exists,
>
> 3.   if it does exist it changes the symbolic  = "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  
> symbolic works.
> Thanks for any insights!
> Bill
>
> //*
> //SET1  SET  SFX=A
> //*
> //CHKEXIST EXEC PGM=IDCAMS
> //SYSPRINT DD SYSOUT=*
> //SYSINDD *
>LISTCAT ENTRIES('Q6498.BIND.ENTLISTA')
> /*
> //CHECKIF IF CHKEXIST.RC < 4 THEN
> //SET2   SET SFX=B
> //CHECKIF ENDIF
> //*
> //STEP3EXEC PGM=SORT
> //SYSOUT   DD SYSOUT=*
> //SORTIN   DD DISP=SHR,DSN=Q6498.BIND.ENTLIST
> //SORTOUT  DD DSN=DUMMY
> //SYSINDD *
>   SORT FIELDS=COPY
> //
>
>
> __
> 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 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

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


Re: JCL IF Condition - I'm Missing Something

2017-02-17 Thread George, William@FTB
Thanks. I guess I'll have to attack the setting of the suffix differently then.


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Jim Brooks
Sent: Friday, February 17, 2017 11:26 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: JCL IF Condition - I'm Missing Something

The SET statement is not executed conditionally. For example, if the SET 
statement appears in an IF/THEN/ELSE/ENDIF statement construct, the value is 
assigned to the symbolic parameter regardless of the logic of the construct.

Regards,
Jim

On Fri, Feb 17, 2017 at 2:03 PM, George, William@FTB <bill.geo...@ftb.ca.gov
> wrote:

> The JCL below
>
> 1.   Sets symbolic  = "A"
>
> 2.   checks if a dataset exists,
>
> 3.   if it does exist it changes the symbolic  = "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  
> symbolic works.
> Thanks for any insights!
> Bill
>
> //*
> //SET1  SET  SFX=A
> //*
> //CHKEXIST EXEC PGM=IDCAMS
> //SYSPRINT DD SYSOUT=*
> //SYSINDD *
>LISTCAT ENTRIES('Q6498.BIND.ENTLISTA')
> /*
> //CHECKIF IF CHKEXIST.RC < 4 THEN
> //SET2   SET SFX=B
> //CHECKIF ENDIF
> //*
> //STEP3EXEC PGM=SORT
> //SYSOUT   DD SYSOUT=*
> //SORTIN   DD DISP=SHR,DSN=Q6498.BIND.ENTLIST
> //SORTOUT  DD DSN=DUMMY
> //SYSINDD *
>   SORT FIELDS=COPY
> //
>
>
> __
> 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 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 Condition - I'm Missing Something

2017-02-17 Thread Jim Brooks
The SET statement is not executed conditionally. For example, if the SET
statement appears in an IF/THEN/ELSE/ENDIF statement construct, the value
is assigned to the symbolic parameter regardless of the logic of the
construct.

Regards,
Jim

On Fri, Feb 17, 2017 at 2:03 PM, George, William@FTB  wrote:

> The JCL below
>
> 1.   Sets symbolic  = "A"
>
> 2.   checks if a dataset exists,
>
> 3.   if it does exist it changes the symbolic  = "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  symbolic
> works.
> Thanks for any insights!
> Bill
>
> //*
> //SET1  SET  SFX=A
> //*
> //CHKEXIST EXEC PGM=IDCAMS
> //SYSPRINT DD SYSOUT=*
> //SYSINDD *
>LISTCAT ENTRIES('Q6498.BIND.ENTLISTA')
> /*
> //CHECKIF IF CHKEXIST.RC < 4 THEN
> //SET2   SET SFX=B
> //CHECKIF ENDIF
> //*
> //STEP3EXEC PGM=SORT
> //SYSOUT   DD SYSOUT=*
> //SORTIN   DD DISP=SHR,DSN=Q6498.BIND.ENTLIST
> //SORTOUT  DD DSN=DUMMY
> //SYSINDD *
>   SORT FIELDS=COPY
> //
>
>
> __
> 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 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 Condition - I'm Missing Something

2017-02-17 Thread George, William@FTB
Thanks John
Actually I did see in my research of what I could be missing so one of my tests 
I placed another SORT step inside the THEN - ENDIF condition and it too was 
processed. That is, as mentioned the THEN condition always processed when the 
CHECKIF return code was RC=0. 
I probably should have shown that test without the SET inside the THEN path as 
the example. :(

Bill

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of John McKown
Sent: Friday, February 17, 2017 11:17 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: JCL IF Condition - I'm Missing Something

On Fri, Feb 17, 2017 at 1:03 PM, George, William@FTB <bill.geo...@ftb.ca.gov

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



> Bill
>
> //*
> //SET1  SET  SFX=A
> //*
> //CHKEXIST EXEC PGM=IDCAMS
> //SYSPRINT DD SYSOUT=*
> //SYSINDD *
>LISTCAT ENTRIES('Q6498.BIND.ENTLISTA')
> /*
> //CHECKIF IF CHKEXIST.RC < 4 THEN
> //SET2   SET SFX=B
> //CHECKIF ENDIF
> //*
> //STEP3EXEC PGM=SORT
> //SYSOUT   DD SYSOUT=*
> //SORTIN   DD DISP=SHR,DSN=Q6498.BIND.ENTLIST
> //SORTOUT  DD DSN=DUMMY
> //SYSINDD *
>   SORT FIELDS=COPY
> //
>
>
> __
> 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>



--
"Irrigation of the land with seawater desalinated by fusion power is ancient. 
It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

--
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 Condition - I'm Missing Something

2017-02-17 Thread John McKown
On Fri, Feb 17, 2017 at 1:03 PM, George, William@FTB  wrote:

> The JCL below
>
> 1.   Sets symbolic  = "A"
>
> 2.   checks if a dataset exists,
>
> 3.   if it does exist it changes the symbolic  = "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  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
​



> Bill
>
> //*
> //SET1  SET  SFX=A
> //*
> //CHKEXIST EXEC PGM=IDCAMS
> //SYSPRINT DD SYSOUT=*
> //SYSINDD *
>LISTCAT ENTRIES('Q6498.BIND.ENTLISTA')
> /*
> //CHECKIF IF CHKEXIST.RC < 4 THEN
> //SET2   SET SFX=B
> //CHECKIF ENDIF
> //*
> //STEP3EXEC PGM=SORT
> //SYSOUT   DD SYSOUT=*
> //SORTIN   DD DISP=SHR,DSN=Q6498.BIND.ENTLIST
> //SORTOUT  DD DSN=DUMMY
> //SYSINDD *
>   SORT FIELDS=COPY
> //
>
>
> __
> 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>



-- 
"Irrigation of the land with seawater desalinated by fusion power is
ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

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


JCL IF Condition - I'm Missing Something

2017-02-17 Thread George, William@FTB
The JCL below

1.   Sets symbolic  = "A"

2.   checks if a dataset exists,

3.   if it does exist it changes the symbolic  = "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  symbolic works.
Thanks for any insights!
Bill

//*
//SET1  SET  SFX=A
//*
//CHKEXIST EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSINDD *
   LISTCAT ENTRIES('Q6498.BIND.ENTLISTA')
/*
//CHECKIF IF CHKEXIST.RC < 4 THEN
//SET2   SET SFX=B
//CHECKIF ENDIF
//*
//STEP3EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DISP=SHR,DSN=Q6498.BIND.ENTLIST
//SORTOUT  DD DSN=DUMMY
//SYSINDD *
  SORT FIELDS=COPY
//


__
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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN