Re: conditional JCL - Reinvent the wheel?

2021-11-16 Thread Clem Clarke
It's about 50 years ago since I wrote Jol, the replacement or 
enhancement language for JCL. And it's my birthday, so I thought I might 
say a word or two.


One of the reasons I wrote Jol was to incorporate PL/I style IF's into 
the language.  And to generally simply the whole JCL process.


Now, unfortunately Google have changed the way you do websites, and so 
the Jol website is definitely not fully operational at the moment.  
However, here is a link to the Jol IF statement: 
https://sites.google.com/oscar-jol.com/jol-if/home


And here is a link to the entire website: www.Oscar-Jol.com

You can read all about the IF here: 
https://sites.google.com/oscar-jol.com/jol-if/home


In essence, the IF Statement can:

 * Compare the values of return codes from executed programs with
   either constants or other program return codes.
 * Compare the current value of symbolic variables with constants or
   other symbolic variables.
 * Test if a program has executed or if a symbolic is declared.
 * Test if End-Of-File (EOF) has been reached on an input file opened
   by OPENFILE
 * Test if an ERROR has occurred.
 * Test the LAST and/or MAXIMUM completion code.

Jol has had other features that are just relatively new to JCL too, such 
as replacing symbolics in card files, a full macro language, an easy way 
to make full screen 3270 panels with Menus, Popups and so on.  There is 
a scheduling package, too.


Since it was originally written in assembler, I developed versions in C 
that ran under OS/2, Windows and Linux.


I would be happy to work with IBM to get it running on the latest and 
greatest Z/OS systems, including the Unix subsystems.  It did run 
AMOCO's entire computer centre for decades, and other large shops such 
as Shell, Air New Zealand and others.



Cheers,

Clem Clarke


Here is a small Jol job and the equivalent JCL to give you an idea of 
the language.


Simplified Jol Scripting Language for Z/OS, TSO, Linux and Windows

Payroll: Job class C 1000 k;
Exec Validate Input.Trans, Trans.Action(+1); /* Validate Transations */
if Validate=0
then do;
    Sort transaction(+1) to Sorted.Trans.Actions(+1)
    Fields(10,10,CH,A);
    Exec Update Payroll.Master(0), Sorted.Trans.Action(+1),
    Payroll.Master(+1);
    If Update = 0
    then do;
    Catalog Payroll.Master(+1), Sorted.Trans.Action(+1);
    Submit Job2;
    end;
end;
else Stop 'Error in PAYROLL Job';



Equivalent Existing Job Control Language

//PAYROLL    JOB  CLASS=C,REGION=1000K
//VALIDATE   EXEC PGM=VALIDATE
//SYSPRINT   DD   SYSOUT=*
//INTRANS    DD   DSN=INPUT.TRANS,DISP=SHR
//OUTTRANS   DD   DSN=TRANS.ACTIONS(+1),DISP=(NEW,PASS),
//    DCB=(RECFM=VB,LRECL=200,BLKSIZE=13030),
//    SPACE=(CYL,(10,10),RLSE),
//    UNIT=SYSDA,VOL=SER=WORK01
//SORT   EXEC PGM=SORT,COND=(VALIDATE,NE,0)
//SYSOUT DD   SYSOUT=*
//SORTWK01   DD   UNIT=SYSDA,SPACE=(CYL,20)
//SORTWK02   DD   UNIT=SYSDA,SPACE=(CYL,20)
//SORTWK03   DD   UNIT=SYSDA,SPACE=(CYL,20)
//SORTIN DD   DSN=TRANS.ACTIONS(+1),DISP=(SHR,PASS)
//SORTOUT    DD   DSN=SORTED.TRANS.ACTIONS(+1),
//    DISP=(NEW,PASS),
//    DCB=(RECFM=VB,LRECL=200,BLKSIZE=13030),
//    SPACE=(CYL,(10,10),RLSE),
//    UNIT=SYSDA,VOL=SER=WORK01
//SYSIN  DD   *
    SORT FIELDS=(10,10,CH,A)
//UPDATE EXEC PGM=UPDATE,COND=(VALIDATE,NE,0)
//SYSPRINT   DD   SYSOUT=*
//MASTIN DD   DSN=PAYROLL.MASTER(0),DISP=SHR
//TRANS  DD   DSN=TRANS.ACTION(+1),DISP=(SHR,PASS)
//MASTOUT    DD   DSN=PAYROLL.MASTER(+1),DISP=(NEW,PASS),
//    DCB=(RECFM=VB,LRECL=200,BLKSIZE=13030),
//    SPACE=(CYL,(10,10),RLSE),
//    UNIT=SYSDA,VOL=SER=WORK01
//CATLG  EXEC PGM=IEFBR14,COND=(UPDATE,NE,0)
//DUMMY1 DD   DSN=PAYROLL.MASTER(+1),DISP=(SHR,CATLG)
//DUMMY2 DD   DSN=SORTED.TRANS.ACTIONS(+1),
//    DISP=(SHR,CATLG)
//SUBMIT EXEC PGM=IEBGENER,COND=(UPDATE,NE,0)
//SYSPRINT   DD   SYSOUT=*
//SYSUT1 DD   DSN=SUBMIT.LIBRARY(JOB2),DISP=SHR
//SYSUT2 DD   SYSOUT=(*,INTRDR)
//SYSIN  DD   DUMMY
//ERRMSG EXEC PGM=SHOWERR,COND=(VALIDATE,EQ,0),
//   PARM='Error in PAYROLL Job'

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


Re: conditional JCL - Reinvent the wheel?

2021-11-14 Thread Paul Gilmartin
On Sun, 14 Nov 2021 17:50:21 +, Robert Prins wrote:

>The symbolic parameter is tested against a valid relational-expression
>keyword, and I'm not using some "IF THIS=&THAT THEN" expression!
>
>Maybe someone from IBM will chip in to once and for all clarify this,
>update the manual, either way, and tell us who is wrong...
>
Please.

Some years ago. Peter Relson (IIRC), replying to me on this topic,
explained that constructs documented as "accepted" but not
"supported" may be reserved for IBM internal use.  His particular
example was undocumented keywords in IBM library macros.

This strikes me as qualitatively different.  But it's possible, however
implausible, that a construct such as:
//  SET MAGIC=''
//L  IF &MAGIC ... THEN
triggers some non=GUPI magic behavior used internally by IBM.
The phrasing in the JCL Ref. seems crafted to allow this.

>> >>>...
>> >>> //SET LI=4095 (skip link)
>> >>> //*SET LI=0 (link if compile is OK)
>> >>> //*
>> >>> //IFLINKIF RC <= 4 & RC >= &LI THEN
>> >>>
>> >> Your use of "&LI" is not "intended or supported" syntax.
>> >> The JCL Ref. says:
>> >>  • You can specify symbolic parameters on IF/THEN/ELSE/ENDIF
>> >>statements provided that they resolve to one of the supported
>> >>relational-expression keywords. Any other symbolic parameters,
>> >>even if accepted by the system, are not intended or supported.
>> >>Refer to “Relational-expression keywords” on page 366.
>> >>
>> >> Neither "0" nor "4095" is among the listed “Relational-expression
>> >> keywords”
>> >
>> >It's fully supported, it has always been possible to use symbols for
>> >return-codes, and for IF-THEN(_ELSE) at least since 1997, when I wrote the 
>> >edit
>> >macros to convert and parametrize production JCL using "COND" for our Y2K 
>> >and euro work.
>> >
>> If you disagree with the clear statement in the book ( SA23-1385-50),
>> "not ... supported", submit an RCF.
>>
>> Let us know the resolution.

-- gil

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


Re: conditional JCL - Reinvent the wheel?

2021-11-14 Thread Robert Prins
The symbolic parameter is tested against a valid relational-expression
keyword, and I'm not using some "IF THIS=&THAT THEN" expression!

Maybe someone from IBM will chip in to once and for all clarify this,
update the manual, either way, and tell us who is wrong...

Robert

On Sun, 14 Nov 2021 at 14:20, Paul Gilmartin <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Sun, 14 Nov 2021 10:19:12 +, Robert Prins wrote:
> >
> >> On Sat, 13 Nov 2021 13:54:15 -0600, Robert Prins wrote:
> >>> Replying via the website, so no context, apologies
> >>>
> (The upside of that was it got the timestamp right.)
> >>...
> >>> //SET LI=4095 (skip link)
> >>> //*SET LI=0 (link if compile is OK)
> >>> //*
> >>> //IFLINKIF RC <= 4 & RC >= &LI THEN
> >>>
> >> Your use of "&LI" is not "intended or supported" syntax.
> >> The JCL Ref. says:
> >>  • You can specify symbolic parameters on IF/THEN/ELSE/ENDIF
> >>statements provided that they resolve to one of the supported
> >>relational-expression keywords. Any other symbolic parameters,
> >>even if accepted by the system, are not intended or supported.
> >>Refer to “Relational-expression keywords” on page 366.
> >>
> >> Neither "0" nor "4095" is among the listed “Relational-expression
> >> keywords”
> >
> >It's fully supported, it has always been possible to use symbols for
> >return-codes, and for IF-THEN(_ELSE) at least since 1997, when I wrote
> the edit
> >macros to convert and parametrize production JCL using "COND" for our Y2K
> and
> >euro work.
> >
> If you disagree with the clear statement in the book ( SA23-1385-50),
> "not ... supported", submit an RCF.
>
> Let us know the resolution.
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>


-- 
Robert AH Prins
robert(a)prino(d)org
The hitchhiking grandfather 
Some REXX code for use on z/OS


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


Re: conditional JCL - Reinvent the wheel?

2021-11-14 Thread Paul Gilmartin
On Sun, 14 Nov 2021 10:19:12 +, Robert Prins wrote:
>
>> On Sat, 13 Nov 2021 13:54:15 -0600, Robert Prins wrote:
>>> Replying via the website, so no context, apologies
>>> 
(The upside of that was it got the timestamp right.)
>>...
>>> //SET LI=4095 (skip link)
>>> //*SET LI=0 (link if compile is OK)
>>> //*
>>> //IFLINKIF RC <= 4 & RC >= &LI THEN
>>>
>> Your use of "&LI" is not "intended or supported" syntax.
>> The JCL Ref. says:
>>  • You can specify symbolic parameters on IF/THEN/ELSE/ENDIF
>>statements provided that they resolve to one of the supported
>>relational-expression keywords. Any other symbolic parameters,
>>even if accepted by the system, are not intended or supported.
>>Refer to “Relational-expression keywords” on page 366.
>>
>> Neither "0" nor "4095" is among the listed “Relational-expression
>> keywords”
>
>It's fully supported, it has always been possible to use symbols for
>return-codes, and for IF-THEN(_ELSE) at least since 1997, when I wrote the edit
>macros to convert and parametrize production JCL using "COND" for our Y2K and
>euro work.
> 
If you disagree with the clear statement in the book ( SA23-1385-50),
"not ... supported", submit an RCF.

Let us know the resolution.

-- gil

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


Re: conditional JCL - Reinvent the wheel?

2021-11-14 Thread Robert Prins

On 2021-11-13 21:05, Paul Gilmartin wrote:

On Sat, 13 Nov 2021 13:54:15 -0600, Robert Prins wrote:


Replying via the website, so no context, apologies


Replying via the website, with context from clicking on the quotation
mark at the upper left of the text composition box, no apologies.


Use "impossible to match" if-then logic, this is what I use in one particular 
job to just compile:

//SET LI=4095 (skip link)
//*SET LI=0 (link if compile is OK)
//*
//IFLINKIF RC <= 4 & RC >= &LI THEN


Your use of "&LI" is not "intended or supported" syntax.
The JCL Ref. says:
 • You can specify symbolic parameters on IF/THEN/ELSE/ENDIF
   statements provided that they resolve to one of the supported
   relational-expression keywords. Any other symbolic parameters,
   even if accepted by the system, are not intended or supported.
   Refer to “Relational-expression keywords” on page 366.

Neither "0" nor "4095" is among the listed “Relational-expression
keywords”


It's fully supported, it has always been possible to use symbols for 
return-codes, and for IF-THEN(_ELSE) at least since 1997, when I wrote the edit 
macros to convert and parametrize production JCL using "COND" for our Y2K and 
euro work.


Robert
--
Robert AH Prins
robert.ah.prins(a)gmail.com
The hitchhiking grandfather - https://prino.neocities.org/
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html

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


Re: conditional JCL - Reinvent the wheel?

2021-11-13 Thread Paul Gilmartin
On Sat, 13 Nov 2021 13:54:15 -0600, Robert Prins wrote:

>Replying via the website, so no context, apologies
> 
Replying via the website, with context from clicking on the quotation
mark at the upper left of the text composition box, no apologies.

>Use "impossible to match" if-then logic, this is what I use in one particular 
>job to just compile:
>
>//SET LI=4095 (skip link)
>//*SET LI=0 (link if compile is OK)
>//*
>//IFLINKIF RC <= 4 & RC >= &LI THEN
> 
Your use of "&LI" is not "intended or supported" syntax. 
The JCL Ref. says:
• You can specify symbolic parameters on IF/THEN/ELSE/ENDIF
  statements provided that they resolve to one of the supported
  relational-expression keywords. Any other symbolic parameters,
  even if accepted by the system, are not intended or supported.
  Refer to “Relational-expression keywords” on page 366.

Neither "0" nor "4095" is among the listed “Relational-expression
keywords”

In old-fashioned JCL, I've used:
//STEP0  EXEC  PGM=IEFBT14
//STEP1  EXEC  whatever,COND=(0,LE)

-- gil

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


Re: conditional JCL - Reinvent the wheel?

2021-11-13 Thread Robert Prins
Replying via the website, so no context, apologies

Use "impossible to match" if-then logic, this is what I use in one particular 
job to just compile:

//SET LI=4095 (skip link)
//*SET LI=0 (link if compile is OK)
//*
//IFLINKIF RC <= 4 & RC >= &LI THEN

Robert
-- 
Robert AH Prins
robert.ah.prins(a)gmail.com
The hitchhiking grandfather - https://prino.neocities.org/
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html

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


Re: conditional JCL - Reinvent the wheel?

2021-11-11 Thread Massimo Biancucci
Colin,

adding to Sri example, we wrote a simple REXX who "understands" a parm like:

ST EXEC PGM=XXCOND,PARM=('"&V1"comparison_operator"&V2"')

where &OP can be =,>,<,<>

like ('"A"="B"')
('"A">"B"') and so on

The simple REXX pgm returns a step CC 1 if the condition is true or zero if
not.
So, nothing really new but more customizable.

Best regards.
Max

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Mail
priva di virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Il giorno mer 10 nov 2021 alle ore 15:05 Sri h Kolusu 
ha scritto:

> Colin,
>
> Why not use IEBCOMPR to compare the symbols and set the return code? If
> both symbols match RC= 0 else RC =8.  something like this (I used COND ,
> but you can use IF ELSE after the first compare.)
>
> // EXPORT SYMLIST=*
> // SET DELUSER='NO'
> // SET DEFUSER='YES'
> /*
> //**
> //* Peform a compare of the set parms  *
> //**
> //COMPARE  EXEC PGM=IEBCOMPR
> //SYSPRINT DD SYSOUT=*
> //SYSUT1   DD *,SYMBOLS=JCLONLY
> &DEFUSER
> //SYSUT2   DD *,SYMBOLS=JCLONLY
> &DELUSER
> //SYSINDD DUMMY
> /*
> //**
> //* SKIP delete user if compare step returns RC = 8*
> //**
> //DELUSER  EXEC PGM=IKJEFT01,COND=(8,EQ,COMPARE)
> //SYSTSPRT DD SYSOUT=*,DCB=BLKSIZE=121
> //SYSPRINT DD SYSOUT=*
> //SYSTSIN  DD *,SYMBOLS=JCLONLY
> /*
>
>
> Thanks,
> Kolusu
>
>
> "IBM Mainframe Discussion List"  wrote on
> 11/10/2021 05:29:37 AM:
>
> > From: "Colin Paice" 
> > To: IBM-MAIN@LISTSERV.UA.EDU
> > Date: 11/10/2021 05:31 AM
> > Subject: [EXTERNAL] conditional JCL - Reinvent the wheel?
> > Sent by: "IBM Mainframe Discussion List" 
> >
> > I'm looking at ways of doing customisation, and want an easy way to
> > run/omit steps.
> > For example
> > ADDUSER  ZZZ NAME('COLINS')NOPASSWORD -
> >OMVS(AUTOUID  ASSIZE(25600)  THREADS(512))
> >
> > being a good person, I also want to provide a delete step
> > DELUSER Z.
> > My fantasy JCL looks like
> > // SET DELUSER='NO'
> > // SET DEFUSER=YES
> > // SET...
> >
> > //IF  (DELUSER='YES')
> > ..
> > DELUSER 
> > //ENDIF
> > //IF  (DEFUSER='YES')
> > ..
> > ADDUSER  ..
> > //ENDIF
> > ...
> >
> > So the first time,  you set DELUSER=NO, DEFUSER=YES... and run it. the
> > second time
> > you set DELUSER=YES, DEFUSER=YES, and to give up,and clean up you set
> > DELUSER=YES, DEFUSER=NO.
> >
> > What is the best way of doing this?
> >
> > The JCL 'IF' statement uses RC, or ABEND, and not on set variables.
> >
> > Ive set up a small program "COND",PARM='A = &ABC' which sets RC = 0 if
> they
> > are the same,
> > so now I can use
> > //DELUSER EXEC PGM=COND,PARM='DELUSER = YES'
> > //DEFUSER EXEC PGM=COND,PARM='DEFUSER = YES'
> > //DELETE EXEC PGM=... ,COND=(0,NE,DELUSER)
> > //DEFINE  EXEC PGM=...,COND=(0,NE,DEFUSER)
> >
> > Is there a better way of doing this?   I would prefer one job, because I
> > want to do global edit of myuserid to Z etc
> >
> > In the past Ive put the deletes inline with the define, but the output
> > looks messy, because the  first time delete fails.
> >
> > Colin
> >
> > --
> > 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: conditional JCL - Reinvent the wheel?

2021-11-11 Thread Seymour J Metz
Also, all references to symbols are evaluated before execution of the first 
step.


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


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Wendell Lovewell [01e9c0ee0673-dmarc-requ...@listserv.ua.edu]
Sent: Thursday, November 11, 2021 1:56 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: conditional JCL - Reinvent the wheel?

Billy's example explains it very well.

A) "IF" cannot be the first step, thus his IEFBR14 call
B) "IF" only allows numerics.  // IF (&DOTHIS="YES") will not work like you 
want, but // IF (&DOTHIS=1) or // IF (&DOTHIS=0) will work. I don't know how 
high of a value you can check, but I've used up to 5 (for day-of-the-week) 
successfully.

Wendell

--
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: conditional JCL - Reinvent the wheel?

2021-11-11 Thread Paul Gilmartin
On Thu, 11 Nov 2021 12:56:21 -0600, Wendell Lovewell  wrote:

>Billy's example explains it very well.  
>
( that apparently refers to:
//  SET RUNTEST1=0 )

>A) "IF" cannot be the first step, thus his IEFBR14 call
>B) "IF" only allows numerics.  // IF (&DOTHIS="YES") will not work like you 
>want, but // IF (&DOTHIS=1) or // IF (&DOTHIS=0) will work. I don't know how 
>high of a value you can check, but I've used up to 5 (for day-of-the-week) 
>successfully. 
>
Repeating what I said earlier:

Be careful.  The JCL Ref. states some peculiarly harsh syntax rules, then:
Relational-expression keywords
The following keywords are the only keywords supported by IBM and
recommended for use in relational- expressions. Any other keywords,
even if accepted by the system, are not intended or supported keywords.

And further:

Comparison operators
Use comparison operators in a relational-expression to compare a keyword with a 
numeric value. The comparison results in a true or false condition.
...
Considerations when using the IF/THEN/ELSE/ENDIF construct
...
• You can specify symbolic parameters on IF/THEN/ELSE/ENDIF statements provided 
that they resolve to one of the supported relational-expression keywords. Any 
other symbolic parameters, even if accepted by the system, are not intended or 
supported. Refer to “Relational-expression keywords” on page 366.

You are relying on constructs which "... even if accepted by the system, 
are not intended or supported."

-- gil

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


Re: conditional JCL - Reinvent the wheel?

2021-11-11 Thread Wendell Lovewell
Billy's example explains it very well.  

A) "IF" cannot be the first step, thus his IEFBR14 call
B) "IF" only allows numerics.  // IF (&DOTHIS="YES") will not work like you 
want, but // IF (&DOTHIS=1) or // IF (&DOTHIS=0) will work. I don't know how 
high of a value you can check, but I've used up to 5 (for day-of-the-week) 
successfully. 

Wendell

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


Re: conditional JCL - Reinvent the wheel?

2021-11-10 Thread Paul Gilmartin
On Wed, 10 Nov 2021 12:29:37 +, Colin Paice  wrote:

>I'm looking at ways of doing customisation, and want an easy way to
>run/omit steps.
>For example
>ADDUSER  ZZZ NAME('COLINS')NOPASSWORD -
>   OMVS(AUTOUID  ASSIZE(25600)  THREADS(512))
>
>being a good person, I also want to provide a delete step
>DELUSER Z.
>My fantasy JCL looks like
>// SET DELUSER='NO'
>// SET DEFUSER=YES
>// SET...
>
>//IF  (DELUSER='YES')
>..
Be careful.  The JCL Ref. states some peculiarly harsh syntax rules, then:
Relational-expression keywords
The following keywords are the only keywords supported by IBM and
recommended for use in relational- expressions. Any other keywords,
even if accepted by the system, are not intended or supported keywords.

It's hard to avoid constructs such as yours that "are not intended
or supported" but appear quite intuitive and are not flagged by
the JCL reader/converter.

Do prevalent JCL checkers reliably flag such unsupported constructs?

Alternatives might be:

o Use of SET symbols in other constructs such as COND=,
  or in DD DATA,SYMBOLS=JCLONLY.

o File tailoring.

Since prion to the availability of DD DATA,SYMBOLS=... I have
kept JCL as here-documents in POSIX shell scripts where I
could employ symbol substitution and process substitution simply
because POSIX shells are what I know better.

-- gil

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


Re: conditional JCL - Reinvent the wheel?

2021-11-10 Thread Colin Paice
Billy,
great - thank you

I'll get the JCL manual updates, as it does not describe this way of doing
things - I read it as only supporting RC, ABEND etc., not variables

Colin

On Wed, 10 Nov 2021 at 15:59, Billy Ashton  wrote:

> Here is a neat little trick I learned from a guy at CA, using SET and
> IF. I use this a lot now, and other than needing a dummy step if I am
> testing the first step in a job, it works great. I have been able to
> nest my IF statements sometimes 3 deep when I have complex processing
> that I want to switch on or off.
>
> Billy
>
> //*
> //* Run the TEST1 process? Set to 1 if yes, 0 if no:
> //  SET RUNTEST1=0
> //*
> //FIRSTSTP  EXEC PGM=IEFBR14Dummy first step for IF tests
> //*
> //I@TEST1  IF &RUNTEST1=1 THEN  "IF" cannot be used before 1st step
> //TEST1PGM  EXEC PGM=IEFBR14
> //*
> //L@TEST1  ELSE
> //TEST1OTH  EXEC PGM=IEFBR14
> //*
> //E@TEST1  ENDIF
> //
>
> --
> 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: conditional JCL - Reinvent the wheel?

2021-11-10 Thread Billy Ashton
Here is a neat little trick I learned from a guy at CA, using SET and 
IF. I use this a lot now, and other than needing a dummy step if I am 
testing the first step in a job, it works great. I have been able to 
nest my IF statements sometimes 3 deep when I have complex processing 
that I want to switch on or off.


Billy

//*
//* Run the TEST1 process? Set to 1 if yes, 0 if no:
//  SET RUNTEST1=0
//*
//FIRSTSTP  EXEC PGM=IEFBR14    Dummy first step for IF tests
//*
//I@TEST1  IF &RUNTEST1=1 THEN  "IF" cannot be used before 1st step
//TEST1PGM  EXEC PGM=IEFBR14
//*
//L@TEST1  ELSE
//TEST1OTH  EXEC PGM=IEFBR14
//*
//E@TEST1  ENDIF
//

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


Re: conditional JCL - Reinvent the wheel?

2021-11-10 Thread Sri h Kolusu
Colin,

Why not use IEBCOMPR to compare the symbols and set the return code? If
both symbols match RC= 0 else RC =8.  something like this (I used COND ,
but you can use IF ELSE after the first compare.)

// EXPORT SYMLIST=*
// SET DELUSER='NO'
// SET DEFUSER='YES'
/*
//**
//* Peform a compare of the set parms  *
//**
//COMPARE  EXEC PGM=IEBCOMPR
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD *,SYMBOLS=JCLONLY
&DEFUSER
//SYSUT2   DD *,SYMBOLS=JCLONLY
&DELUSER
//SYSINDD DUMMY
/*
//**
//* SKIP delete user if compare step returns RC = 8*
//**
//DELUSER  EXEC PGM=IKJEFT01,COND=(8,EQ,COMPARE)
//SYSTSPRT DD SYSOUT=*,DCB=BLKSIZE=121
//SYSPRINT DD SYSOUT=*
//SYSTSIN  DD *,SYMBOLS=JCLONLY
/*


Thanks,
Kolusu


"IBM Mainframe Discussion List"  wrote on
11/10/2021 05:29:37 AM:

> From: "Colin Paice" 
> To: IBM-MAIN@LISTSERV.UA.EDU
> Date: 11/10/2021 05:31 AM
> Subject: [EXTERNAL] conditional JCL - Reinvent the wheel?
> Sent by: "IBM Mainframe Discussion List" 
>
> I'm looking at ways of doing customisation, and want an easy way to
> run/omit steps.
> For example
> ADDUSER  ZZZ NAME('COLINS')NOPASSWORD -
>OMVS(AUTOUID  ASSIZE(25600)  THREADS(512))
>
> being a good person, I also want to provide a delete step
> DELUSER Z.
> My fantasy JCL looks like
> // SET DELUSER='NO'
> // SET DEFUSER=YES
> // SET...
>
> //IF  (DELUSER='YES')
> ..
> DELUSER 
> //ENDIF
> //IF  (DEFUSER='YES')
> ..
> ADDUSER  ..
> //ENDIF
> ...
>
> So the first time,  you set DELUSER=NO, DEFUSER=YES... and run it. the
> second time
> you set DELUSER=YES, DEFUSER=YES, and to give up,and clean up you set
> DELUSER=YES, DEFUSER=NO.
>
> What is the best way of doing this?
>
> The JCL 'IF' statement uses RC, or ABEND, and not on set variables.
>
> Ive set up a small program "COND",PARM='A = &ABC' which sets RC = 0 if
they
> are the same,
> so now I can use
> //DELUSER EXEC PGM=COND,PARM='DELUSER = YES'
> //DEFUSER EXEC PGM=COND,PARM='DEFUSER = YES'
> //DELETE EXEC PGM=... ,COND=(0,NE,DELUSER)
> //DEFINE  EXEC PGM=...,COND=(0,NE,DEFUSER)
>
> Is there a better way of doing this?   I would prefer one job, because I
> want to do global edit of myuserid to Z etc
>
> In the past Ive put the deletes inline with the define, but the output
> looks messy, because the  first time delete fails.
>
> Colin
>
> --
> 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: conditional JCL - Reinvent the wheel?

2021-11-10 Thread David Spiegel

Hi Colin,
Add a TSO Step in which a CLIST/Rexx does a "LU Userid", trap the output 
and if your program "sees" ICH30001I UNABLE TO LOCATE USER ENTRY, avoid 
the DELUSER.


Regards,
David

On 2021-11-10 07:29, Colin Paice wrote:

I'm looking at ways of doing customisation, and want an easy way to
run/omit steps.
For example
ADDUSER  ZZZ NAME('COLINS')NOPASSWORD -
OMVS(AUTOUID  ASSIZE(25600)  THREADS(512))

being a good person, I also want to provide a delete step
DELUSER Z.
My fantasy JCL looks like
// SET DELUSER='NO'
// SET DEFUSER=YES
// SET...

//IF  (DELUSER='YES')
..
DELUSER 
//ENDIF
//IF  (DEFUSER='YES')
..
ADDUSER  ..
//ENDIF
...

So the first time,  you set DELUSER=NO, DEFUSER=YES... and run it. the
second time
you set DELUSER=YES, DEFUSER=YES, and to give up,and clean up you set
DELUSER=YES, DEFUSER=NO.

What is the best way of doing this?

The JCL 'IF' statement uses RC, or ABEND, and not on set variables.

Ive set up a small program "COND",PARM='A = &ABC' which sets RC = 0 if they
are the same,
so now I can use
//DELUSER EXEC PGM=COND,PARM='DELUSER = YES'
//DEFUSER EXEC PGM=COND,PARM='DEFUSER = YES'
//DELETE EXEC PGM=... ,COND=(0,NE,DELUSER)
//DEFINE  EXEC PGM=...,COND=(0,NE,DEFUSER)

Is there a better way of doing this?   I would prefer one job, because I
want to do global edit of myuserid to Z etc

In the past Ive put the deletes inline with the define, but the output
looks messy, because the  first time delete fails.

Colin

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


conditional JCL - Reinvent the wheel?

2021-11-10 Thread Colin Paice
I'm looking at ways of doing customisation, and want an easy way to
run/omit steps.
For example
ADDUSER  ZZZ NAME('COLINS')NOPASSWORD -
   OMVS(AUTOUID  ASSIZE(25600)  THREADS(512))

being a good person, I also want to provide a delete step
DELUSER Z.
My fantasy JCL looks like
// SET DELUSER='NO'
// SET DEFUSER=YES
// SET...

//IF  (DELUSER='YES')
..
DELUSER 
//ENDIF
//IF  (DEFUSER='YES')
..
ADDUSER  ..
//ENDIF
...

So the first time,  you set DELUSER=NO, DEFUSER=YES... and run it. the
second time
you set DELUSER=YES, DEFUSER=YES, and to give up,and clean up you set
DELUSER=YES, DEFUSER=NO.

What is the best way of doing this?

The JCL 'IF' statement uses RC, or ABEND, and not on set variables.

Ive set up a small program "COND",PARM='A = &ABC' which sets RC = 0 if they
are the same,
so now I can use
//DELUSER EXEC PGM=COND,PARM='DELUSER = YES'
//DEFUSER EXEC PGM=COND,PARM='DEFUSER = YES'
//DELETE EXEC PGM=... ,COND=(0,NE,DELUSER)
//DEFINE  EXEC PGM=...,COND=(0,NE,DEFUSER)

Is there a better way of doing this?   I would prefer one job, because I
want to do global edit of myuserid to Z etc

In the past Ive put the deletes inline with the define, but the output
looks messy, because the  first time delete fails.

Colin

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