BookmarkSubscribeRSS Feed
CharlesR
Calcite | Level 5
Ok, so the previous thread i started, i don't think can be accomplished as stated. But i think this will work:

I'm trying to do a many-to-many match merge, but i have a problem: rather than having 1 variable = 1 variable, i have 5 variables to merge "by". I don't think i can do this in SAS, but it would also work to have the 5 variables compound to one variable showing each of the permutations of the 5, then doing the merge by the new single variable. I could then do the merge using Proc SQL with: one variable showing the permutations = one variable showing the permutations.

Can anyone show me how to do this?

Thanks!
2 REPLIES 2
DBailey
Lapis Lazuli | Level 10
do you mean something like this?

proc sql;
select * from tab1 t1 outer join tab2 t2 on t1.var1=t2.var1 and t1.var2=t2.var2 and t1.var3=t2.var3 and t1.var4=t2.var4 and t1.var5=t2.var5;
quit;
CharlesR
Calcite | Level 5
That's exactly what i mean. Though i ended up concatenating the variables to form one variable.

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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