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
 

 

USING When Conditions

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

Moderator


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

PostPosted: Tue Jun 26, 2012 12:17 pm    Post subject:
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    Post subject: Reply to: USING When Conditions
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

Moderator


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

PostPosted: Tue Jun 26, 2012 12:53 pm    Post subject: Re: Reply to: USING When Conditions
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: 1232
Location: Israel

PostPosted: Tue Jun 26, 2012 3:04 pm    Post subject: Re: USING When Conditions
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

Site Director


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

PostPosted: Tue Jun 26, 2012 10:13 pm    Post subject:
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    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 Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts DFSORT report with multiple conditions Bill Woodger DFSORT/ICETOOL 9 Wed Jan 20, 2016 2:19 am
No new posts Conditions on SORT to avoid extra space vicharapusrinu JCL & VSAM 17 Thu Jan 16, 2014 1:29 pm
No new posts How to merge VSAM files with some con... Gopalakrishnan V JCL & VSAM 20 Thu May 30, 2013 1:24 pm
No new posts Joinkeys to match both conditions mfchnuser JCL & VSAM 13 Mon Dec 17, 2012 7:22 pm


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