Hello. I've a little problem. How can I join 2 tables and keep the data of columns with the same name? The data of 2 tables is different, and i need make a new table with the result.
The name of tables are:
And the same columns of both tables are called "Burks" and "Blartd". The output must be create a new table, with the name "Final".
Thanks in advanced.
Francisco
The answer is easy: no.
You can rename the two column in input
data final;
merge Directa Folios (rename=(Burks=folios_Burks Blartd=folios_Blartd));
by xxx;
run;
If you append you can.
Hi.Thanks for the answer. I try to explain with more details:
Dataset P1
Position | Code | Class |
1 | AF | A |
2 | AG | B |
3 | AH | C |
4 | AI | D |
5 | AJ | E |
Dataset P2
Position | Code |
6 | AA |
7 | AB |
8 | AC |
9 | AD |
10 | AE |
And I need the new data set call P_New:
Position | Code | Class |
1 | AF | A |
2 | AG | B |
3 | AH | C |
4 | AI | D |
5 | AJ | E |
6 | AA | |
7 | AB | |
8 | AC | |
9 | AD | |
10 | AE |
Thanks in advanced for your help.
Regards,
Francisco
It's an append.
Ypu can do with a datastep
data new;
set pi_1 P_new;
run;
Or with the proc append.
Proc append base=P_1 data=P_new force; run;
The code is written by memory so some error could be in it. Test it and change it.
Or you can just stack them
data final;
set Directa
Folios;
run;
As long as they are in the same positions, ie the data that you had presented earlier this will just stack the two of them on top of each other.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.