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" <[email protected]> wrote on
11/10/2021 05:29:37 AM:

> From: "Colin Paice" <[email protected]>
> To: [email protected]
> Date: 11/10/2021 05:31 AM
> Subject: [EXTERNAL] conditional JCL - Reinvent the wheel?
> Sent by: "IBM Mainframe Discussion List" <[email protected]>
>
> 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 [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to