View previous topic :: View next topic |
Author |
Message |
John Corbin Beginner
Joined: 23 Jan 2004 Posts: 38 Topics: 21
|
Posted: Fri Jan 14, 2005 2:57 pm Post subject: Using logical OR in REXX |
|
|
Hi gang...
If I have code like
SELECT
WHEN code ='A' | CODE = 'B' | CODE = 'C'
more code here
OTHERWISE
more code here
END
does the line code ='A' | CODE = 'B' | CODE = 'C'
read the same as code ='A' or CODE = 'B' or CODE = 'C'
Is there another way to code this ... I was thinking of
SELECT
WHEN code = 'A'
WHEN code = 'B'
WHEN code = 'C'
more code here
OTHERWISE
more code here
END |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Jan 14, 2005 4:16 pm Post subject: |
|
|
John,
All IF and WHEN clauses must be followed by a THEN clause. So you cannot code as you have shown
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
John Corbin Beginner
Joined: 23 Jan 2004 Posts: 38 Topics: 21
|
Posted: Fri Jan 14, 2005 4:57 pm Post subject: |
|
|
I neglected to add the THEN part...
Am more interested in the OR part though |
|
Back to top |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Mon Jan 17, 2005 1:53 am Post subject: |
|
|
John, depending on your emulator or where you are reading your rexx you did interpret it correctly as an 'or' character. You could code alternately like you did, but you would have to have that batch of 'more code here' after each when statement or place it in a called routine. |
|
Back to top |
|
 |
|
|