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 (July 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: sdlenter <sdlentert@AOL.COM>
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


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