From: Scott Bass on 23 Dec 2009 18:59 Hi, Is there a better way to "clear out" an Excel workbook than deleting the existing file? This works, and is my desired output, although not my desired approach: libname xl "c:\temp\test.xls"; data one two three; x=1; run; proc copy in=work out=xl; select one three; run; libname xl; * clear out previous output ; systask command "del c:\temp\test.xls" wait; libname xl "c:\temp\test.xls"; proc copy in=work out=xl; select two; run; libname xl; This doesn't work, the *data* in the worksheets are deleted, but not the worksheet tab: libname xl "c:\temp\test.xls"; data one two three; x=1; run; proc copy in=work out=xl; select one three; run; * clear out previous output ; proc datasets lib=xl kill nowarn nolist; quit; proc copy in=work out=xl; select two; run; libname xl; Thanks, Scott
|
Pages: 1 Prev: scientific notation Next: Reading a big .CSV file into SAS |