MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using logical OR in REXX

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
John Corbin
Beginner


Joined: 23 Jan 2004
Posts: 38
Topics: 21

PostPosted: Fri Jan 14, 2005 2:57 pm    Post subject: Using logical OR in REXX Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Jan 14, 2005 4:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
John Corbin
Beginner


Joined: 23 Jan 2004
Posts: 38
Topics: 21

PostPosted: Fri Jan 14, 2005 4:57 pm    Post subject: Reply with quote

I neglected to add the THEN part...

Am more interested in the OR part though
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Mon Jan 17, 2005 1:53 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group