BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8
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.
4 REPLIES 4
deleted_user
Not applicable
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
SASPhile
Quartz | Level 8
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!!
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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?
deleted_user
Not applicable
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1324 views
  • 0 likes
  • 3 in conversation