SAS export multiple sheet to EXCEL and Replace the whole file

Accepted Solution Solved
Reply
Super Contributor
Posts: 503
Accepted Solution

SAS export multiple sheet to EXCEL and Replace the whole file

Hi Everyone,

I export multiple sheets to 1 excel file like below.

I wonder when I redo my work, how can I delete the whole old Excel file.

Thank you for your help.

HC

 

*First Export , 2 sheets;

proc export data=sashelp.class (where=(age=11))
             outfile="C:\Users\hoang.nguyen\Documents\sas temp\multi.xlsx"
dbms=xlsx    replace ;
   sheet="Monday";run;

proc export data=sashelp.class(where=(age=12))
             outfile="C:\Users\hoang.nguyen\Documents\sas temp\multi.xlsx"
             dbms=xlsx replace ;
   sheet="Tuesday";run;

*Second Export --> How can I delete the old file
This code below only add new sheet to the old file;
proc export data=sashelp.cars 
             outfile="C:\Users\hoang.nguyen\Documents\sas temp\multi.xlsx"
dbms=xlsx    replace ;
run;

Accepted Solutions
Solution
‎12-15-2017 05:43 PM
Super User
Posts: 23,296

Re: SAS export multiple sheet to EXCEL and Replace the whole file

FDELETE() function.

View solution in original post


All Replies
Solution
‎12-15-2017 05:43 PM
Super User
Posts: 23,296

Re: SAS export multiple sheet to EXCEL and Replace the whole file

FDELETE() function.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 546 views
  • 0 likes
  • 2 in conversation