DATA Step, Macro, Functions and more

Proc export

Reply
Super Contributor
Posts: 673

Proc export

PROC EXPORT DBMS=EXCEL DATA= work.trials
OUTFILE= "c:\Biopharm Business Analysis SAS Project (2009)\BSM Prescriber Reports\trials.xls" REPLACE;
SHEET="report";

RUN;


When I run the above code,instead of going to the specified sheet "report" the output is redirected to report1. i have not created a sheet "report1".
"1" is added to whatever sheet name i define.
N/A
Posts: 0

Re: Proc export

Hello SASPhile,

I don't really know the cause of the problem. But ... did you know that it is possible to export to excel using an Excel engine? I would do this:

libname myxls "c:\Biopharm Business Analysi......";

proc sql;
create table myxls.report as
select *
from work.trials;
quit;

There is something very nice: you can use Excel as any other database engine.

Does it help?

Yoba
Super Contributor
Posts: 673

Re: Proc export

Posted in reply to deleted_user
libname myxls "C\Biopharm Business Analysis SAS Project (2009)\BSM Prescriber Reports\nonofeiba1.xls";

proc sql;
create table myxls.report as
select *
from work.novo_fieba;
quit;

Tried this..but the access is denied!!
Super Contributor
Super Contributor
Posts: 3,174

Re: Proc export

Best to paste the actual SAS log content (with SAS generated NOTE and other diagnostic ERROR messages intact), rather than the SAS code -- is the LIBNAME statement formatted correctly with your drive letter missing a trailing colon character, possibly?
N/A
Posts: 0

Re: Proc export

Hold on ... do you get the error message when you try to open the excel file? If so, you have to unassign the library before opening the excel file. You can do this with the following syntax:

libname myxls clear; Message was edited by: yoba
Ask a Question
Discussion stats
  • 4 replies
  • 178 views
  • 0 likes
  • 3 in conversation