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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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