I have two excel files test1 and test2 test1.xlsx has three tabs as shown below
test1.xlsx has 3 tabs
APPLE
A | B | C |
123 | 4 | 5 |
2 | 2.3 | 4.5 |
orange
A | B | C | D |
123 | 4 | 5 | 6 |
2 | 2.3 | 4.5 | 7 |
grape
A | B | C |
123 | 4 | 5 |
2 | 2.3 | 4.5 |
TEST2.XLSX has two tabs
apple
A | B | C |
55 | 55 | 66 |
2 | 2.3 | 4.5 |
orange
A | B | C | D |
46 | 36 | 59 | 6 |
2 | 2.3 | 4.5 | 7 |
and after appending Test1 and Test2.xlsx my final excel file test3.xlsx should look like below with 3 tabs
APPLE
A | B | C |
123 | 4 | 5 |
2 | 2.3 | 4.5 |
55 | 55 | 66 |
2 | 2.3 | 4.5 |
ORANGE
A | B | C | D |
123 | 4 | 5 | 6 |
2 | 2.3 | 4.5 | 7 |
46 | 36 | 59 | 6 |
2 | 2.3 | 4.5 | 7 |
grape
A | B | C |
123 | 4 | 5 |
2 | 2.3 | 4.5 |
Can anyone please help how do I append two excel files ?
I'm assuming you want to do this in SAS?
First import your data to have SAS data sets
You can write a PROC IMPORT step or use the Import Utility, which will generate the code:
Then I would suggest looking into PROC APPEND.
@jhh197 wrote:
I have two excel files test1 and test2 test1.xlsx has three tabs as shown below
test1.xlsx has 3 tabs
APPLE
A B C 123 4 5 2 2.3 4.5
orange
A B C D 123 4 5 6 2 2.3 4.5 7
grape
A B C 123 4 5 2 2.3 4.5
TEST2.XLSX has two tabs
apple
A B C 55 55 66 2 2.3 4.5
orange
A B C D 46 36 59 6 2 2.3 4.5 7
and after appending Test1 and Test2.xlsx my final excel file test3.xlsx should look like below with 3 tabs
APPLE
A B C 123 4 5 2 2.3 4.5 55 55 66 2 2.3 4.5
ORANGE
A B C D 123 4 5 6 2 2.3 4.5 7 46 36 59 6 2 2.3 4.5 7
grape
A B C 123 4 5 2 2.3 4.5
Can anyone please help how do I append two excel files ?
What version of SAS are you using, what operating system is SAS running on, and do you licence the SAS/ACCESS Interface to PC Files?
Vince DelGobbo
SAS R&D
I am running SAS EG 71 64 bit
Thank you
Do you want to use the point-and-click interfaces, or do you want to write your own SAS code?
Please submit this code from your SAS Enterprise Guide session, and then post the log:
%put &=SYSVLONG &=SYSSCPL;
proc product_status; run; quit;
Vince DelGobbo
SAS R&D
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.