Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10326
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: 10326
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us