BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sultana
Calcite | Level 5

I have 3 data sets with different variables, but a account numbers as the common variable among all the 3 tables. need to match any account listed in either or both of the tables.

Need to find the same account number in all the dataset.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
data want;
merge have1(in=t1) have2(in=t2) have3(in=t3);
by ID;

if t1&  t2 & t3;
run;

@Sultana wrote:

need to match any account listed in either or both of the tables.

Need to find the same account number in all the dataset.


IMO those are contradictory statements. 

Match Merging is documented here: https://documentation.sas.com/?docsetId=lrcon&docsetTarget=n1tgk0uanvisvon1r26lc036k0w7.htm&docsetVe...

View solution in original post

1 REPLY 1
Reeza
Super User
data want;
merge have1(in=t1) have2(in=t2) have3(in=t3);
by ID;

if t1&  t2 & t3;
run;

@Sultana wrote:

need to match any account listed in either or both of the tables.

Need to find the same account number in all the dataset.


IMO those are contradictory statements. 

Match Merging is documented here: https://documentation.sas.com/?docsetId=lrcon&docsetTarget=n1tgk0uanvisvon1r26lc036k0w7.htm&docsetVe...

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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