The SAS Output Delivery System and reporting techniques

how to do one to many merge in SAS

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

how to do one to many merge in SAS

how to proceede for one to many merge in SAS


Accepted Solutions
Solution
‎04-25-2016 03:50 PM
Frequent Contributor
Posts: 108

Re: how to do one to many merge in SAS

You can simply do it by merge statement or you can use Proc SQL joiins.

 

DATA Step Match-Merge PROC SQL Full Outer Join
data merged;
merge three four;
by x;
run;
proc print data=merged noobs;
title ’Table Merged’;
run;

 


proc sql;
title ’Table Merged’;
select three.x, a, b
from three
full join
four
on three.x = four.x
order by x;

 

 

 

View solution in original post


All Replies
Solution
‎04-25-2016 03:50 PM
Frequent Contributor
Posts: 108

Re: how to do one to many merge in SAS

You can simply do it by merge statement or you can use Proc SQL joiins.

 

DATA Step Match-Merge PROC SQL Full Outer Join
data merged;
merge three four;
by x;
run;
proc print data=merged noobs;
title ’Table Merged’;
run;

 


proc sql;
title ’Table Merged’;
select three.x, a, b
from three
full join
four
on three.x = four.x
order by x;

 

 

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 367 views
  • 2 likes
  • 2 in conversation