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;
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.
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.