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 15:19:20 -0400
Reply-To:     Annie Lee <hummingbird10111@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Annie Lee <hummingbird10111@HOTMAIL.COM>
Subject:      Searching for SSN string

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


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