On an IF statement, yes, but what about SELECT?

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

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Paul Gilmartin [[email protected]]
Sent: Sunday, June 20, 2021 8:39 AM
To: [email protected]
Subject: Re: Coding for the future

On Sun, 20 Jun 2021 10:48:09 +0100, Jeremy Nicoll wrote:
>>
>> For example, something like this:
>>
>>   /* is this a user we want to process? */
>>   do
>>     if name='' then exit do /* no */
>>     if st<>'NC' then exit do /* no */
>>     amount=GetAmount(userID)
>>     if amount>9999 then exit do /* no */
>>     call ProcessUser; end
>>
"exit do" exits the EXEC, returning the value of the symbol DO
to its caller.  Is that what was intended?

>Really?  What's wrong with
>
>select
>  when name='' then nop
>  when st<>'NC' then nop
>  when GetAmount(userID) > 9999 then nop
>  otherwise call ProcessUser
>end
>
I dislike the negative logic, even as I'd rarely code:
    if X<>Y
        then nop
        else whatever

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