On Wed, 22 Feb 2017 14:20:10 -0600, John McKown wrote:
>> >
>> No.  Where would you code the DEFAULT/OTHERWISE clause?
>​
>>//IF1  IF ...
>...
>//   ELSE
>//IF2  IF
>...
>//    ELSE
>//IF3  IF
>...
>​//OTHRWISE​ ELSE
>​...
>//ENDIF3 ENDIF
>//ENDIF2 ENDIF
>//ENDIF2 ENDIR​
> 
Still no.  The OTHERWISE clause is not performed if either IF1 or IF2 is false;
only if both IF1 and IF2 are true and IF3 is false.

>​But I agree that // ELSIF or // ELSEIF would be superior. DEFAULT /
>OTHERWISE is simply after the last ELSE. Perhaps instead of // IF, IBM
>should have have // CASE?
>
>//SETRC EXEC PGM=SOMEPGM
>//CHKRC  CASE
>// WHEN RC=0 THEN
>...
>// WHEN RC=4 THEN
>..
>// DEFAULT
>...
>// ENDCASE​ CHKRC
> 
Yup.  The Rexx SELECT is merely a string of ELSEIFs.

>Where the CHKRC on the // ENDCASE is actually checked to match the label on
>the previous // CASE .

-- gil

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

Reply via email to