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 (June 2012, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 12 Jun 2012 10:52:29 -0500
Reply-To:     "Data _null_;" <iebupdte@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Data _null_;" <iebupdte@GMAIL.COM>
Subject:      Re: In() Function
Comments: To: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@dshs.wa.gov>
In-Reply-To:  <F7E6D18CC2877149AB5296CE54EA2766024DC263@WAXMXOLYMB002.WAX.wa.lcl>
Content-Type: text/plain; charset=ISO-8859-1

That's why we need documentation. :-)

On 6/12/12, Nordlund, Dan (DSHS/RDA) <NordlDJ@dshs.wa.gov> wrote: >> -----Original Message----- >> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of >> Joe Matise >> Sent: Monday, June 11, 2012 6:34 PM >> To: SAS-L@LISTSERV.UGA.EDU >> Subject: Re: In() Function >> >> I interpreted Mike's rules to be: >> *Works like WHICHN function, except that all arguments are truncated to >> the >> length of the first argument. This differs from WHICHN, which makes >> each >> comparison exactly (so 'IN' is not equal to 'INDEX'). IN('IN','INDEX') >> would return TRUE. >> >> So whereas WHICHN will process each comparison as >> IN1 = IN2 >> IN() processes each comparison as >> IN1 =: IN2 >> > <<<snip>>> > > Joe, > > The IN() function only "kind of works" like > > IN1 =: IN2 > > The "=:" operator compares IN1 and IN2 up to the length of the shorter of > the two strings, regardless of whether the shorter string is IN1 or IN2. > > The IN() function appears to return FALSE if IN2 is shorter than IN1. > > data _null_; > in1 = 'abc'; > in2 = 'ab'; > compare1 = in(in1,in2); > compare2 = in1 =: in2; > put compare1= compare2=; > run; > > > Hope this is helpful, > > Dan > > Daniel J. Nordlund > Washington State Department of Social and Health Services > Planning, Performance, and Accountability > Research and Data Analysis Division > Olympia, WA 98504-5204 >


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