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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.