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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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