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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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