Hi,
I'm trying to export datasets into different sheets in an excel file (xlsx.).
I got a successful error message about that exporting, but actually, there is no new file existing at the path:
NOTE: The export data set has 300711 observations and 48 variables.
NOTE: "C:\Users\******\Desktop\new.xlsx" file was successfully created
NOTE: PROCEDURE EXPORT used (Total process time):
real time 1:39.91
CPU time 1:29.51
this is the code:
Proc EXPORT DATA=SQLPLAN.HYBRID_WORK
OUTFILE="C:\Users\******\Desktop\new.xlsx"
DBMS=XLSX REPLASE;
SHEET="TEST";
RUN;
Please help me figure that out!
Thanks a lot!
Do not use a filename for the target, only the path; it needs to be a folder. On the source, use the fully qualified filename.
If your SAS runs on a remote server, the file is created there, not on your PC.
Hi,
I'm confused, because if I'm using the simple way of exporting files:
right-click on the data set ->Export -> Export WORK.HYBRID_WORK...
the file definitely created on my PC, so why by writing a code it doesn't work?
there is any other way to export datasets into sheets in an existing excel file in SAS EG?
Thanks again!
The code that is submitted by EG is run on the SAS server.
When you use the export wizard in EG, EG creates the file on the server and takes care of downloading the result to your PC behind the scene. When you write code and run it, you also need to do the download yourself, e.g. by using the Copy Files task.
Hi,
I tried the Copy Files as you said, while at the project it linked to the Export program I send before.
at the Source files to copy from "SASApp" I filled: "/u/&SYSUSERID./DATA" - that what I shoud fill?
and at the Destination folder on "PC405****" I filled: "C:\Users\****\Desktop\new.xlsx"
and I got the following error message:
"ERROR: Target folder (C:\Users\****\Desktop\new.xlsx) does not exist or cannot be accessed on PC405****
Thanks!!
Do not use a filename for the target, only the path; it needs to be a folder. On the source, use the fully qualified filename.
With a successful execution, you get a message telling you where the file was copied.
If the file does not show upon your screen, try a refresh. Alternatively, start a command window (which should start in your home directory), do a cd Desktop and then dir.
Sorry, I made a mistake.
I did get an error message:
"ERROR: Object reference not set to an instance of an object"
If you want to export datasets as sheets to an existing Excel file, that file must reside in the context of the SAS workspace server process, so you can use it in a LIBNAME XLSX.
I would suggest that you talk with your network/server admins so that they set up a network resource that is available both on the SAS server and on user's desktops; once you put files there, they will be available synchronously in all environments.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.