Your code doesn't do what he was apparently trying to do., due to the loop and 
the RETURN.


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


________________________________________
From: IBM Mainframe Discussion List <[email protected]> on behalf of 
Paul Gilmartin <[email protected]>
Sent: Monday, September 30, 2019 3:28 PM
To: [email protected]
Subject: Re: Rexx calls versus branching

On Mon, 30 Sep 2019 13:48:11 -0500, Bill Giannelli wrote:

>My statement is as follows:
>SELECT
>     WHEN ssid = "XXXX" THEN grp = "ZZZZ"
>
>     WHEN ssid = " " THEN say 'subsystem not entered';
>                          call code
>OTHERWISE
>          NOP
>END
>
>I thought it was falling though when SSID was blank.
>But what I neglected was a null value for SSID.
>
My refactoring; my personal style:

SIGNAL ON NOVALUE /* Strongly recommended to trap unassigned variables.  */

ssid = " "  /* or something else to test.  */

SELECT
     WHEN ssid = "XXXX" THEN grp = "ZZZZ"

/*        Use "==" for literal comparison.
*/
     WHEN ssid = "XXXX" THEN grp = "ZZZZ"

     WHEN ssid= = " " THEN
                     DO blank_ssid = 42 until 1
                          say 'subsystem not entered';
                          call code
                          RETURN     /* In order not to fall through.  */
                     END blank_ssid  /* Label DO for legibility.  */
     OTHERWISE
          NOP
END

code:  PROCEDURE EXPOSE ssid
     SAY "code was called when ssid = """ssid""""
     RETURN

-- gil

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