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