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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 268 views
  • 0 likes
  • 2 in conversation