LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 8 Feb 2007 17:11:42 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: In : Question
Comments: To: iw1junk@COMCAST.NET
In-Reply-To:  <020820071656.806.45CB5631000D237600000326220730079305029A06CE9907@comcast.net>
Content-Type: text/plain; format=flowed

Ian ,

Thanks I had thought about case, truncation issues and leading blanks but not trailing blanks.

Data _Null_ ; x = "red" ; If X In : ( 'Red' 'Blue' 'Green' ) Then Y = 'Match' ; put y= ;

x = "G" ; If Strip( X ) In : ( 'Red' 'Blue' 'Green' ) Then Y = 'Match' ; put y= ; run ;

Y= Y=Match

Toby Dunn

To sensible men, every day is a day of reckoning. ~John W. Gardner

The important thing is this: To be able at any moment to sacrifice that which we are for what we could become. ~Charles DuBois

Don't get your knickers in a knot. Nothing is solved and it just makes you walk funny. ~Kathryn Carpenter

From: Ian Whitlock <iw1junk@COMCAST.NET> Reply-To: iw1junk@COMCAST.NET To: SAS-L@LISTSERV.UGA.EDU Subject: In : Question Date: Thu, 8 Feb 2007 16:56:17 +0000

Summary: Yes. #iw-value=1

Toby,

There are many things you should be aware of, but I have no idea whether you are or are not. Some might be surprised at these tests, and some might not.

1 data _null_ ; 2 x = "G" ; 3 If X In : ( 'Red' 'Blue' 'Green' ) Then Y = 'Match' ; 4 put y= ; 5 run ;

Y=Match NOTE: DATA statement used (Total process time): real time 0.07 seconds cpu time 0.03 seconds

6 data _null_ ; 7 x = "red" ; 8 If X In : ( 'Red' 'Blue' 'Green' ) Then Y = 'Match' ; 9 put y= ; 10 x = "G" ; 11 If X In : ( 'Red' 'Blue' 'Green' ) Then Y = 'Match' ; 12 put y= ; 13 run ;

Y= Y=

Ian Whitlock ==============

Date: Thu, 8 Feb 2007 16:19:51 +0000 Reply-To: toby dunn <tobydunn@HOTMAIL.COM> Sender: "SAS(r) Discussion" From: toby dunn <tobydunn@HOTMAIL.COM> Subject: In : Question Content-Type: text/plain; format=flowed

Anyone know of something that I should be aware of when using the In operator and colon modifier together like:

If X In : ( 'Red' 'Blue' 'Green' ) Then Y = 'Match' ;

Toby Dunn

To sensible men, every day is a day of reckoning. ~John W. Gardner

The important thing is this: To be able at any moment to sacrifice that which we are for what we could become. ~Charles DuBois

Don't get your knickers in a knot. Nothing is solved and it just makes you walk funny. ~Kathryn Carpenter

_________________________________________________________________ Invite your Hotmail contacts to join your friends list with Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us


Back to: Top of message | Previous page | Main SAS-L page