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

USING When Conditions


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

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue Jun 26, 2012 12:00 pm
Reply with quote

Hi,

I need to check different values of a variable using WHEN conditions. and these values needs to behave as NOT equal,

Since it is NOT equal we needs to combine these values using AND condition (&), Correct?

If so is the below Rexx code correct,

when ((top \= 9) & (top \= W) & (top \= Y) & (top \= Z)) then do
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 26, 2012 12:17 pm
Reply with quote

What happened when you tried????
Back to top
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue Jun 26, 2012 12:30 pm
Reply with quote

I haven't tested it, as there are few constraints in doing so.
I just wanted to know whether the code which i have mentioned is correct or not..
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 26, 2012 12:53 pm
Reply with quote

Sumeendar wrote:
I haven't tested it, as there are few constraints in doing so.


Very weird constraints for not testing a REXX program which doesn't need any compilation I am sorry to say it is a lame excuse like saying "I forgot my id password so can't work today"
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jun 26, 2012 3:04 pm
Reply with quote

Sumeendar wrote:
If so is the below Rexx code correct,

when ((top \= 9) & (top \= W) & (top \= Y) & (top \= Z)) then do


In REXX there are other (better?) ways to do that:
Code:
/* if top is one of the 4 letters, pos will have a value of 1 to 4  */
/* if top does not contains one of the letters, pos will return 0   */
/* but will return false positive if top contains 9W or WY or YZ    */
when Pos(top,'9WYZ') = 0 then do

Code:
/* quite similar, without the false positives                       */
when WordPos(top,'9 W Y Z') = 0 then do


Can't run tests ? That's tough ! icon_cry.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jun 26, 2012 10:13 pm
Reply with quote

Hello,

Quote:
I haven't tested it, as there are few constraints in doing so.
Either you are quite lazy or you are not really interested in doing this kind of work.

If you can edit you code in tso/ispf, you can test. . . icon_confused.gif

Maybe not the entire process, but what you ask about can easily be tested with a tiny bit of code that is only for testing this particular requirement.
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 How to load to DB2 with column level ... DB2 6
No new posts Db2 SQL - how to switch among differe... DB2 18
No new posts To search DB2 table based on Conditio... DB2 1
This topic is locked: you cannot edit posts or make replies. SUM based on two conditions using SYN... SYNCSORT 7
No new posts SORT - Multiple Conditions DFSORT/ICETOOL 4
Search our Forums:

Back to Top