LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2001, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 2 Jan 2001 12:04:05 -0500
Reply-To:     "Fehd, Ronald J." <rjf2@CDC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Fehd, Ronald J." <rjf2@CDC.GOV>
Subject:      Re: From SAS to Excel
Comments: To: cwf <wfcheung@ALUMNI.CUHK.EDU.HK>
Content-Type: text/plain; charset="iso-8859-1"

> From: cwf [mailto:wfcheung@ALUMNI.CUHK.EDU.HK] > What kinds of problem exist in my program below that I can't > put the sas output to excel file?

> ERROR: Physical file does not exist, C:\Program > Files\SAS\excel|d:\temp\[temp.xls]Sheet1!R1C3:R3C3. > NOTE: The SAS System stopped processing this step because of errors.

"well it wrote the Excel file the first time I tried this code. and since then, I get this strange error message!"

SAS will not write over an existing Excel file. see the macro below for code to delete the file.

Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov OpSys: WinNT Ver: 8.1 ---> cheerful provider of TESTED SAS code!*! <--- remember perspective: the error is not always where it seems to occur! -- RJF2

%MACRO SAS2XLS( DSN ,LIBRARY=LIBRARY ,OUT = ,PATH =&PATH_XLS.); %IF "&OUT." = "" %THEN %LET OUT = &DSN.;

%*DOS x "del &PATH.\&OUT..XLS";

filename FILE2DEL "&PATH.\&OUT..XLS"; data _NULL_; Rc=fdelete('FILE2DEL'); SysMsg=sysmsg(); put Rc= SysMsg=;

PROC DBLOAD dbms=EXCEL data=&LIBRARY..&DSN.; path="&PATH.\&OUT..XLS"; putnames yes; *****label; *****reset all; limit=0; load; run;%*................................;%MEND; %*SAS2XLS(TBL8F);


Back to: Top of message | Previous page | Main SAS-L page