Re: Kind of COND in a CLIST

2016-07-21 Thread Edward Gould
Indeed there are many ways to skin a cat.
With ISPF edit there are many ways to insert clist commands to imbed them into 
the list almost automatically.
IOW there is no best way to do this.
Use your imagination and have a got at it.
Ed

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


Re: Kind of COND in a CLIST

2016-07-21 Thread Elardus Engelbrecht
Radoslaw Skorupka wrote:

>I'm going to submit huge command list in a batch (IKJEFT01). The commands are 
>unrelated (no loops, etc.) however I want to stop the script after command 
>failure, that means RC<>0.

>Example:

>RDEF class PROFILE1.** ...
>RDEF class PROFILE2.** ...
>RDEF class PROFILE3.** ...
>...
>PERMIT profile1.** ID(some grp) ACC(UPDATE)

>Let's say second command fails (RDEF PROFILE2) so, script is aborted, RDEF 
>PROFILE3 is not issued.

I would go the way Lizette said. Put your commands in a dataset. Create a REXX 
program, read line by line and execute them. Check your RC based on the result 
of each command. Exit loop if RC <> 0.

Based on the RDEF result, you could simply skip those PERMIT commands, by 
checking the profile in RACF.

It should not be too hard to do that. [1] 

I would also consider other's replies. They are very interesting alternatives. 
Many ways to skin this little cat!

Groete / Greetings
Elardus Engelbrecht


[1] - I have several REXX programs which are doing more or less the same. Read 
a Dataset with info, parse each line, create RACF commands and place them in a 
dataset for review. If all is Ok, then I simple execute them.

Oh, yes, I have written on RACF-L, years ago, that I wrote a REXX program using 
ISPF panels to create / modify one id or a range of ids by creating RACF 
commands. This program issues a LU command and either create AU or ALU commands 
depending whether the ids are already defined in RACF. The same goes for mass 
deletion of ids.

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


Re: Kind of COND in a CLIST

2016-07-21 Thread Paul Gilmartin
On Thu, 21 Jul 2016 09:00:52 -0700, Lizette Koehler wrote:

>I would think putting your commands in a DATASET, then using REXX to execute
>them one at a time and check the return code would work.
> 
With Rexx I'd use SIGNAL ON NOVALUE and wrap the few commands for
which RC<>0 with call to a subroutine that locally disables the trap.

I have several jobs with a two-statement SYSTSIN that REPROs another
SYSIN to a temporary PDS then EXECs that member.

Theres a hack that can be used to run a Rexx EXEC directly from SYSIN.
It's documented only indirectly and probably unsupported.  I don't
use it.

-- gil

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


Re: Kind of COND in a CLIST

2016-07-21 Thread Lizette Koehler
I would think putting your commands in a DATASET, then using REXX to execute
them one at a time and check the return code would work.

If it is required to do it with a CLIST then the same logic would work.




Lizette


> -Original Message-
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
> Behalf Of R.S.
> Sent: Thursday, July 21, 2016 5:37 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Kind of COND in a CLIST
> 
> I'm going to submit huge command list in a batch (IKJEFT01). The commands are
> unrelated (no loops, etc.) however I want to stop the script after command
> failure, that means RC<>0.
> 
> Example:
> //STEP1   EXEC PGM=IKJEFT01
> //SYSTSPRT DD  SYSOUT=*
> //SYSTSIN  DD  *,DLM=@@
> /* command list */
> RDEF class PROFILE1.** ...
> RDEF class PROFILE2.** ...
> RDEF class PROFILE3.** ...
> ...
> PERMIT profile1.** ID(some grp) ACC(UPDATE) PERMIT profile2.** ID(some grp)
> ACC(UPDATE) PERMIT profile3.** ID(some grp) ACC(UPDATE) ...
> 
> Let's say second command fails (RDEF PROFILE2) so, script is aborted, RDEF
> PROFILE3 is not issued.
> 
> Any clue?
> 
> --
> Radoslaw Skorupka
> Lodz, Poland
> 

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


Re: Kind of COND in a CLIST

2016-07-21 Thread Mick Graley
Also if you were to create a CLIST for this as suggested previously,
rather than adding lots of IFs or WHENs, you should just be able to
specify CONTROL FLUSH once at the beginning of the CLIST.

Mick.


On 21 July 2016 at 14:24, Norbert Friemel  wrote:
> On Thu, 21 Jul 2016 14:36:30 +0200, R.S. wrote:
>
>> I'm going to submit huge command list in a batch (IKJEFT01). The
>> commands are unrelated (no loops, etc.) however I want to stop the
>> script after command failure, that means RC<>0.
>>
>> Example:
>> //STEP1   EXEC PGM=IKJEFT01
>> //SYSTSPRT DD  SYSOUT=*
>> //SYSTSIN  DD  *,DLM=@@
>> /* command list */
>> RDEF class PROFILE1.** ...
>> RDEF class PROFILE2.** ...
>
> Replace IKJEFT01 with IKJEFT1A (or IKJEFT1B)?
> https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.ikjc200/jcl_exec.htm
>
> Norbert Friemel
>
> --
> 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: Kind of COND in a CLIST

2016-07-21 Thread Norbert Friemel
On Thu, 21 Jul 2016 14:36:30 +0200, R.S. wrote:

> I'm going to submit huge command list in a batch (IKJEFT01). The
> commands are unrelated (no loops, etc.) however I want to stop the
> script after command failure, that means RC<>0.
> 
> Example:
> //STEP1   EXEC PGM=IKJEFT01
> //SYSTSPRT DD  SYSOUT=*
> //SYSTSIN  DD  *,DLM=@@
> /* command list */
> RDEF class PROFILE1.** ...
> RDEF class PROFILE2.** ...

Replace IKJEFT01 with IKJEFT1A (or IKJEFT1B)?
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.ikjc200/jcl_exec.htm

Norbert Friemel

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


Re: Kind of COND in a CLIST

2016-07-21 Thread Walt Farrell
On Thu, 21 Jul 2016 14:36:30 +0200, R.S.  wrote:

>I'm going to submit huge command list in a batch (IKJEFT01). The 
>commands are unrelated (no loops, etc.) however I want to stop the 
>script after command failure, that means RC<>0.
>
>Example:
>//STEP1   EXEC PGM=IKJEFT01
>//SYSTSPRT DD  SYSOUT=*
>//SYSTSIN  DD  *,DLM=@@
>/* command list */
>RDEF class PROFILE1.** ...
>RDEF class PROFILE2.** ...
>RDEF class PROFILE3.** ...
>...
>
>Let's say second command fails (RDEF PROFILE2) so, script is aborted, 
>RDEF PROFILE3 is not issued.
>
>Any clue?

First, that's not a CLIST (as implied in your subject line). It's merely a list 
of TSO commands. If it were a CLIST, then possibly using the WHEN command after 
each command could solve your problem. It is documented as working after CALL 
and LOADGO commands, but might work after other commands, too. WHEN (SYSRC > 0) 
END would be useful in a CLIST if it works after other commands.

Even without it being a CLIST, WHEN might work, but I can't run an experiment 
to find out. Perhaps WHEN (SYSRC > 0) LOGOFF would do it?

-- 
Walt

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


Re: Kind of COND in a CLIST

2016-07-21 Thread Hardee, Chuck
Radoslaw,

I would put the commands into a CLIST (or REXX) and add IF logic to check the 
return code from each command and EXIT when it's not an acceptable value.

Chuck

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 R.S.
Sent: Thursday, July 21, 2016 8:37 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Kind of COND in a CLIST

I'm going to submit huge command list in a batch (IKJEFT01). The 
commands are unrelated (no loops, etc.) however I want to stop the 
script after command failure, that means RC<>0.

Example:
//STEP1   EXEC PGM=IKJEFT01
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  *,DLM=@@
/* command list */
RDEF class PROFILE1.** ...
RDEF class PROFILE2.** ...
RDEF class PROFILE3.** ...
...
PERMIT profile1.** ID(some grp) ACC(UPDATE)
PERMIT profile2.** ID(some grp) ACC(UPDATE)
PERMIT profile3.** ID(some grp) ACC(UPDATE)
...

Let's say second command fails (RDEF PROFILE2) so, script is aborted, 
RDEF PROFILE3 is not issued.

Any clue?

-- 
Radoslaw Skorupka
Lodz, Poland






---
Treść tej wiadomości może zawierać informacje prawnie chronione Banku 
przeznaczone wyłącznie do użytku służbowego adresata. Odbiorcą może być jedynie 
jej adresat z wyłączeniem dostępu osób trzecich. Jeżeli nie jesteś adresatem 
niniejszej wiadomości lub pracownikiem upoważnionym do jej przekazania 
adresatowi, informujemy, że jej rozpowszechnianie, kopiowanie, rozprowadzanie 
lub inne działanie o podobnym charakterze jest prawnie zabronione i może być 
karalne. Jeżeli otrzymałeś tę wiadomość omyłkowo, prosimy niezwłocznie 
zawiadomić nadawcę wysyłając odpowiedź oraz trwale usunąć tę wiadomość 
włączając w to wszelkie jej kopie wydrukowane lub zapisane na dysku.

This e-mail may contain legally privileged information of the Bank and is 
intended solely for business use of the addressee. This e-mail may only be 
received by the addressee and may not be disclosed to any third parties. If you 
are not the intended addressee of this e-mail or the employee authorized to 
forward it to the addressee, be advised that any dissemination, copying, 
distribution or any other similar activity is legally prohibited and may be 
punishable. If you received this e-mail by mistake please advise the sender 
immediately by using the reply facility in your e-mail software and delete 
permanently this e-mail including any copies of it either printed or saved to 
hard drive.

mBank S.A. z siedzibą w Warszawie, ul. Senatorska 18, 00-950 Warszawa, 
www.mBank.pl, e-mail: kont...@mbank.pl
Sąd Rejonowy dla m. st. Warszawy XII Wydział Gospodarczy Krajowego Rejestru 
Sądowego, nr rejestru przedsiębiorców KRS 025237, NIP: 526-021-50-88. 
Według stanu na dzień 01.01.2016 r. kapitał zakładowy mBanku S.A. (w całości 
wpłacony) wynosi 168.955.696 złotych.


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