Colin, adding to Sri example, we wrote a simple REXX who "understands" a parm like:
STXXXX 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 <skol...@us.ibm.com> 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 > //SYSIN DD 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" <IBM-MAIN@LISTSERV.UA.EDU> wrote on > 11/10/2021 05:29:37 AM: > > > From: "Colin Paice" <colinpai...@gmail.com> > > 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" <IBM-MAIN@LISTSERV.UA.EDU> > > > > I'm looking at ways of doing customisation, and want an easy way to > > run/omit steps. > > For example > > ADDUSER ZZZZZZZ NAME('COLINS') NOPASSWORD - > > OMVS(AUTOUID ASSIZE(256000000) THREADS(512)) > > > > being a good person, I also want to provide a delete step > > DELUSER ZZZZZ. > > My fantasy JCL looks like > > // SET DELUSER='NO' > > // SET DEFUSER=YES > > // SET... > > > > //IF (DELUSER='YES') > > .. > > DELUSER ZZZZ > > //ENDIF > > //IF (DEFUSER='YES') > > .. > > ADDUSER ZZZZ .. > > //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 ZZZZZ 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