Hi all,
I am having problem in combining two tables with different no. of columns.
compare_y1 | y1 | d | beta |
111 | 111 | 0 | 0 |
111 | 50 | 0 | 0 |
111 | 172 | 0 | 1 |
111 | 37 | 0 | 0 |
111 | 639 | 0 | 1 |
111 | 20 | 0 | 0 |
compare_y2 | y2 | d1 | beta1 |
81 | 81 | 0 | 0 |
81 | 240 | 0 | 1 |
81 | 831 | 0 | 1 |
81 | 256 | 0 | 1 |
81 | 890 | 0 | 1 |
81 | 577 | 0 | 1 |
Now if I type command:
data table3;
set tabel1 table2;
run;
I dont have the table3 I want.
Any help i can have table3 like this?
compare_y1 | y1 | d | beta | compare_y2 | y2 | d1 | beta1 |
111 | 111 | 0 | 0 | 81 | 81 | 0 | 0 |
111 | 50 | 0 | 0 | 81 | 240 | 0 | 1 |
111 | 172 | 0 | 1 | 81 | 831 | 0 | 1 |
111 | 37 | 0 | 0 | 81 | 256 | 0 | 1 |
111 | 639 | 0 | 1 | 81 | 890 | 0 | 1 |
111 | 20 | 0 | 0 | 81 | 577 | 0 | 1 |
Are you looking for one to one merge?
data want;
set table1;
set table2;
run;
or
data want;
merge table1 table2;
run;
Are you looking for one to one merge?
data want;
set table1;
set table2;
run;
or
data want;
merge table1 table2;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.