Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

REXX OR condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: REXX OR condition
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Wed May 27, 2009 12:15 pm    Post subject: Reply to: REXX OR condition
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Wed May 27, 2009 3:46 pm    Post subject: Reply to: REXX OR condition
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us