Help using Base SAS procedures

append two excel files

Reply
Contributor
Posts: 40

append two excel files

I have two excel files test1 and test2 test1.xlsx has three tabs as shown below

test1.xlsx has 3 tabs

APPLE

ABC
12345
22.34.5

 

orange

ABCD
123456
22.34.57

 

grape

ABC
12345
22.34.5

 

TEST2.XLSX has two tabs

apple

ABC
555566
22.3

4.5

 

orange

ABCD
4636596
22.34.57

 

and after appending Test1 and Test2.xlsx my final excel file test3.xlsx should look like below with 3 tabs

APPLE

ABC
12345
22.34.5
555566
22.3

4.5

 

ORANGE

ABCD
123456
22.34.57
4636596
22.34.57

 

grape

ABC
12345
22.34.5

 

Can anyone please help how do I append two excel files ?

 

 

Super User
Posts: 23,763

Re: append two excel files

[ Edited ]

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:

http://video.sas.com/detail/video/4664358166001/using-the-import-data-utility-in-sas-studio?autoStar...

 

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 ?

 

 


 

 

SAS Super FREQ
Posts: 356

Re: 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

Contributor
Posts: 40

Re: append two excel files

Posted in reply to Vince_SAS

I am running SAS EG 71 64 bit

 

 

 

 

Thank you

SAS Super FREQ
Posts: 356

Re: append two excel files

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

Ask a Question
Discussion stats
  • 4 replies
  • 228 views
  • 0 likes
  • 3 in conversation