BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MichEz
Calcite | Level 5

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!

 

1 ACCEPTED SOLUTION
9 REPLIES 9
MichEz
Calcite | Level 5

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!

Kurt_Bremser
Super User

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.

MichEz
Calcite | Level 5

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!!

MichEz
Calcite | Level 5
Hi,
Thanks!
Now, I didn't get any error message, but still the file is not exported.
this is the log right now:

"Downloading files from SAS session on "SASApp" to local machine "PC405****"

settings:
Source file specification: /u/&SYSUSERID./new.xlsx
Destination path: C:\Users\*****\Desktop
Overwrite existing files: Yes
Resolve macro references in file paths: Yes
Convert line endings for text files: No

Note: Resolving macro expressions in file paths. SAS log:"

So, what it could be now in your opinion?
Kurt_Bremser
Super User

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.

MichEz
Calcite | Level 5

Sorry, I made a mistake.

 

I did get an error message:

 

"ERROR: Object reference not set to an instance of an object"

Kurt_Bremser
Super User

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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

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.

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
  • 9 replies
  • 1223 views
  • 0 likes
  • 2 in conversation