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 (July 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 19 Jul 2010 19:43:43 +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: Searching for SSN string
Comments: To: hummingbird10111@hotmail.com
In-Reply-To:  <201007191919.o6JIxKai015180@willow.cc.uga.edu>
Content-Type: text/plain; charset="iso-8859-1"

Assuming you have only one string of 9 consecutive digits and those 9 are in fact the SSN value you are looking for:

SSN = PrxChange( 's/^(.*?)(\d{9})(.*?)$/$2/o' , 1 , AcctSSN ) ;

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: Mon, 19 Jul 2010 15:19:20 -0400 > From: hummingbird10111@HOTMAIL.COM > Subject: Searching for SSN string > To: SAS-L@LISTSERV.UGA.EDU > > What is the best way to search for a SSN string with the following data set. > > Is there a better way to search for the correct SSN string instead of > writing many different substr statements? Thank you. > > > > SSN1 = substr(AcctSSN, 1, 7); > > SSN2 = substr(AcctSSN, 2, 8); > > > > I am looking for SSN = "123456789" (character) > > > > > > data > > > > ID AcctSSN > > > > 120 023456780W > > 123 123456780W > > 111 123456781W > > 112 123456782W > > 113 A123456783 > > 114 AA123456784 > > 115 AAA123456785 > > 116 123456786BB1234 > > 117 A123456789BB5678 > > 118 AA123456787BB6789 > > > > > > Results I would like: > > > > ID SSN AcctSSN > > > > 117 123456789 A123456789BB5678 _________________________________________________________________ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3


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