BookmarkSubscribeRSS Feed
oolugboji
Calcite | Level 5

Firstname

lastname

John & Susan

                           Wood , Temple

John, Mike, Dana

Brown, Kent,

Terry, Nelson, Reobert

Rohr & Little

 

I have a large table(about 100k rows) as above that contains the multiple first names, and multiple last names which I need to validate against my names library. After Validation, My table should look like this(similar to my names library).

 

Firstname

Last Name

John

Wood

Susan

Temple

John

Kent

Mike Dana

Brown

Terry

Rohr

Nelson

Little

 

I have already split the names into different columns like so:

data test;

   set data_in;

   length name1-name5 $10. surname1-surname5 $10. ;

   array name(5) $;

   array surname(5) $;

   do i = 1 to dim(name);

      name[i]=scan(STRIP(firstname),i,' &/','M');

       surname[i]=scan(lastname,i,' &/','M');

 

   end;

run;

 

Q My question is how do I begin to search for one name and multiple lastnames or one lastname and multiple names in the names library

 

1 REPLY 1
JosvanderVelden
SAS Super FREQ
There are many ways. Have a look at the paper: https://support.sas.com/resources/papers/proceedings15/2219-2015.pdf

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 375 views
  • 0 likes
  • 2 in conversation