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
|