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: 10274
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: 10274
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
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts REXX WTO for console message bipinpeter CLIST & REXX 6 Tue Jun 27, 2017 3:56 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am


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