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...

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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