Date: Mon, 24 Jul 2006 09:47:50 -0700
Reply-To: "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Subject: Re: proc sql - invalid data
In-Reply-To: A<1153759109.942002.129700@p79g2000cwp.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"
Hi,
In the WHERE clause you can use the LIKE
operator. e.g.
WHERE yourvar like "00%"
The % is a wildcard symbol.
"00%" looks for strings starting with "00".
"%00%" would look for any occurance of "00".
"%00" looks for strings ending with "00".
data sample;
yourvar = "0012345"; output;
yourvar = "3400145"; output;
yourvar = "4560015"; output;
yourvar = "0012345"; output;
yourvar = "1234500"; output;
run;
proc sql;
create table result as
select
count(yourvar) as theCount
from
sample
where
yourvar like "00%"
;
quit;
Hope this is helpful.
Mark Terjeson
Senior Programmer Analyst, IM&R
Russell Investment Group
Russell
Global Leaders in Multi-Manager Investing
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
sdlenter
Sent: Monday, July 24, 2006 9:39 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: proc sql - invalid data
in proc sql can i look for invalid data that starts with a certain
number or letter or contains a certain number or letter. Example i need
to find values where Field1 starts with '00' and count those invalid
fields