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 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 13 Jun 2008 14:29:08 +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: Keep records with a specific number of digits
Comments:   To: ledaniels7@gmail.com
In-Reply-To:   <9f3bbe09-0ec0-41be-bbbe-e4ad53b2ad5a@k13g2000hse.googlegroups.com>
Content-Type:   text/plain; charset="Windows-1252"

Data Have ; Infile Cards ; Input Var $10. ; Cards ; 54A8 1234 58932 320482390 123abx77s 4323 3243 ; Run ;

Data Need ; Set Have ; Where PrxMatch( '/^\d{4}$/O' , Strip(Var) ) ; Run ;

Proc Print Data = Need ; Run ;

Toby Dunn

"Don't bail. The best gold is at the bottom of barrels of crap." Randy Pausch

"Be prepared. Luck is where preparation meets opportunity." Randy Pausch

> Date: Thu, 12 Jun 2008 12:25:11 -0700 > From: ledaniels7@GMAIL.COM > Subject: Keep records with a specific number of digits > To: SAS-L@LISTSERV.UGA.EDU > > Could someone tell me how I can keep only the records that have a > certain number of digits? > > Example: > Variable > 5468 > 58932 > 320482390 > 4323 > 3243 > > I am looking to keep only the records with 4 digits, so I only want 3 > records - 5468, 4323, 3243.

_________________________________________________________________ Itís easy to add contacts from Facebook and other social sites through Windows Liveô Messenger. Learn how. https://www.invite2messenger.net/im/?source=TXT_EML_WLH_LearnHow


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