I'm using the following code to output to Excel; but I'm noticing that it doesn't REPLACE old data with new. What would be a better solution if I'm constantly updating data with new data that I want written out to same excel file and worksheet. Thanks
libname myxls "U:\QEP\Revenue\Revenue_Statistics\DSH_DATA\RevStats.xls";
libname myxls clear;
What's unclear from your post is whether you are getting any type of SAS error in your SAS-generated log output. This would be useful to learn. Also, if there is some error, I recommend you reply to your post with a COPY/PASTE snapshot from the error point leading up to the error condition. Lastly, are you able to use this same code to generate a new Excel document -- again something useful for your own (as well as the forum) debugging response/input.
NOTE: Libref MYXLS was successfully assigned as follows:
Physical Name: U:\QEP\Revenue\Revenue_Statistics\DSH_DATA\RevStats.xls
ERROR: The MS Excel table check has been opened for OUTPUT. This table already exists, or there is a name conflict with an existing object. This
table will not be replaced. This engine does not support the REPLACE option.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 3:03.54
cpu time 0.11 seconds
659 data myxls.check;
660 set b2;
661 libname myxls clear;
NOTE: Libref MYXLS has been deassigned.
With your last error log, you need to code a RUN; statement before the LIBNAME.
The SAS support http://support.sas.com/ website has SAS-hosted DOC and supplemental technical and conference papers - available using either the website SEARCH facility or Google - here is one I found which discusses REPLACE not being an option, as well as showing applicable examples: