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 [email protected] with the message: INFO IBM-MAIN

Reply via email to