IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REXX OR condition


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Wed May 27, 2009 12:14 pm
Reply with quote

hi,

I am new to REXX.

Actually I am struggling with putting an OR condition in my code. though I followed the IBM matrial but probably I am too novice to locate the syntax error.

what I wrote is --

SAY 'ENETER THE CURRENT MONTH '
PULL MM
IF ((MM=12)|(MM=01)|(MM=02))
SAY 'WINTER'
ELSE
SAY 'SUMMER'


While executing I am getting an error

4 +++ IF ((MM=12):
IRX0013I Error running TEST, line 4: Invalid character in program
***


Can somebody plz guide in this?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed May 27, 2009 12:15 pm
Reply with quote

the or symbols has always been a pain in the ***
it depends on Your terminal char mapping,
try using the exclamation mark
Back to top
View user's profile Send private message
abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Wed May 27, 2009 12:22 pm
Reply with quote

Thanks , thanks, thanks.. a ton.

I have lost almost 2 days behind this icon_eek.gif
Back to top
View user's profile Send private message
abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Wed May 27, 2009 3:19 pm
Reply with quote

Hi !!

I need one more help.

while using WHEN - OTHERWISE statements if a condition happens where
for two or more values of a var i need to do the same action the how to write the code.

I mean --

WHEN X = 1 OR 2 OR 3
dO action
OTHERWISE
NOP
...

i am not getting this in the manual. I have tried the way we do in COBOL but that is not working.
icon_rolleyes.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed May 27, 2009 3:46 pm
Reply with quote

You must use single compares

Code:
when a = 1 <or>
        b  = 2 ......


or for a string comparison on a list

instead of
Code:
when a = "wwww" <or>
        a = "xxx" <or>
        a = "zzzzzzz" ......
I often use the wordpos
Code:

when wordpos(a,"wwww xxx zzzzzz") > 0 then ....

 ......
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top