cancel
Showing results for 
Search instead for 
Did you mean: 

PROC APPEND not updating Excel file

SOLVED
Highlighted
arunrami
Pyrite | Level 9
Solved!

PROC APPEND not updating Excel file

Hello Friends,

 

I am trying to update the existing excel sheet using using proc append( Need to add extra row) but I am getting following error message. Can anyone help what is wrong?

 

51         proc append base= test.sheet1 data=dummy force;
ERROR: Update access is not supported for file TEST.sheet1.DATA.
52         run;

 

p.s - I am accesing the excel file using lib name statement.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User
Solution

Re: PROC APPEND not updating Excel file

Pull the existing sheet to a SAS dataset, do the append in SAS, and then replace the sheet in the Excel file. As the message says, you can't append via libname excel.

View solution in original post

5 REPLIES 5
Kurt_Bremser
Super User
Solution

Re: PROC APPEND not updating Excel file

Pull the existing sheet to a SAS dataset, do the append in SAS, and then replace the sheet in the Excel file. As the message says, you can't append via libname excel.

arunrami
Pyrite | Level 9

Re: PROC APPEND not updating Excel file

Thanks Brem! One more sub question- I hope you don'e mind answering it.. While using proc append , its always taking the length of the variable for from the base data set and newly added variable are truncated accordingly.. is there any way to make it flexible or redefining the length based on new data??

 

 

cosmid
Lapis Lazuli | Level 10

Re: PROC APPEND not updating Excel file

I don't think so. With Proc Append, the base file prevails in everything. The only way is to modify the attributes in the base file before running Proc Append.

Kurt_Bremser
Super User

Re: PROC APPEND not updating Excel file


@arunrami wrote:

Thanks Brem! One more sub question- I hope you don'e mind answering it.. While using proc append , its always taking the length of the variable for from the base data set and newly added variable are truncated accordingly.. is there any way to make it flexible or redefining the length based on new data??

 

 


No. proc append does exactly what its name says, and since it does not touch the existing data in the dataset (and therefore can't change that), the attributes of the base will prevail.

To change the attributes of the existing data, the dataset needs to be rewritten (rename of variables or a change of formats can be done with proc datasets without a complete rewrite, but length changes need a rewrite).

arunrami
Pyrite | Level 9

Re: PROC APPEND not updating Excel file

Thanks a lot!! you are a real expert in SAS
My kind request - Please share your if are already having blog or youtube for SAS teaching,, if not please start something like that .. I will be the first to follow Smiley Happy