LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (October 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 5 Oct 2011 09:01:45 -0500
Reply-To:   Joe Matise <snoopy369@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Joe Matise <snoopy369@GMAIL.COM>
Subject:   Re: Do loop
Comments:   To: Subscribe Sas-L Jkr <jayakumarreddy@gmail.com>
In-Reply-To:   <201110051348.p95AlPDb026217@waikiki.cc.uga.edu>
Content-Type:   text/plain; charset=ISO-8859-1

Ah, I misplaced the |.

data out; set in; array values $ value1-value45; if find('|'||catx('|', of value1-value45)||'|', '|82962|')then found_82962=1; if (found_82962 and type=2 and source in ('2','3')); run;

You also need the $ if they're char variables.

-Joe

On Wed, Oct 5, 2011 at 8:48 AM, Subscribe Sas-L Jkr <jayakumarreddy@gmail.com> wrote: > I am using your code and my value1-value45 are character variables but i get > an error . > > this is the message > > > NOTE: Numeric values have been converted to character values at the places > given by: > (Line):(Column). > 119:4 > NOTE: Character values have been converted to numeric values at the places > given by: > (Line):(Column). > 119:78 > NOTE: Invalid numeric data, ' 0|' , at line 119 column 78. > > Is there something wrong in the find statement??? > > > On Tue, 4 Oct 2011 20:30:00 -0500, Joe Matise <snoopy369@GMAIL.COM> wrote: > >>Oops, forgot the initial and closing |. >>data out; >>set in; >>array values value1-value45; >>if find('|'||catx('|', of value1-value45), '|82962|')||'|' then found_82962=1; >>if (found_82962 and type=2 and source in ('2','3')); >>run; >> >> >> >>On Tue, Oct 4, 2011 at 8:29 PM, Joe Matise <snoopy369@gmail.com> wrote: >>> data out; >>> set in; >>> array values value1-value45; >>> if find(catx('|', of value1-value45), '|82962|') then found_82962=1; >>> if (found_82962 and type=2 and source in ('2','3')); >>> run; >>> >>> -Joe >>> >>> >>> On Tue, Oct 4, 2011 at 5:10 PM, Subscribe Sas-L Jkr >>> <jayakumarreddy@gmail.com> wrote: >>>> I am trying to check for Variable Name Range list to see if it is equal to a >>>> value and also have a where clause in my statement >>>> >>>> >>>> data out; >>>> set in; >>>> array X (45) value1-value45; >>>> do i = 1 to 45; >>>> do while >>>> ( >>>> value(i) = '82962' >>>> ); >>>> end; >>>> end; >>>> TOB = catt( of A B C) >>>> where Type = '2' >>>> and (source = '2' or source = '3'); >>>> run; >>>> >>>> i want to see if one of value1 to value45 have 82962 and where type is 2 and >>>> source is 2 or 3 >>>> >>>> is my above program correct? >>>> >>>> is it efficient? >>>> >>>> i appreciate assistance >>>> >>>> thanks >>>> >>>> >>>> thanks >>>> >>>> JKR >>>> >>> >


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