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

Hello all,

 

I am creating a Sas EG project to export some very large datasets to csv. Unfortunately it's not possible to use proc export for the export because the data are in a remote sasapp. The option to use export as step in a project is fine, except that it then immediately starts exporting which means I cannot keep working on the rest of the file. Since the exports take long (more than an hour) this is a bit annoying. Is there a way to create the export step but not execute it until the whole project is executed?

 

Thanks for any suggestions!

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

I would consider using a server-side export (PROC EXPORT) and then the Copy Files task to download the result.  I've got a blog post here showing how.

 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

View solution in original post

10 REPLIES 10
Tom
Super User Tom
Super User

I don't use EG but is sounds like you just want to change the order of the blocks in process flow diagram.  If you don't need to put the EXPORT step right next to the step that creates the data to be exported then why not just move it to later in the process flow.

bouz22
Calcite | Level 5
Unfortunately I don't think this would help as the creation of the export step immediately executes it, forcing me to wait hours until the export is done before I can continue with the next file.
ChrisHemedinger
Community Manager

I would consider using a server-side export (PROC EXPORT) and then the Copy Files task to download the result.  I've got a blog post here showing how.

 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
bouz22
Calcite | Level 5

Thank you, this is very helpful! It works, now I have to think a bit about how to integrate this into my existing macro's but I will work something out. The csv files I am creating on the server, is there a way for me to delete these at the end of the process? I can imagine the IT department will not be too happy if I leave all these files on their server.

ChrisHemedinger
Community Manager

You can create the CSV files in the temp WORK location, and they will be deleted when the SAS session ends.

 

%let download_from = %sysfunc(getoption(WORK))/out.csv;
filename out "&download_from";
proc export
 data=sashelp.cars
 dbms=csv
 outfile=out
 replace;
run;
Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
bouz22
Calcite | Level 5

Thank you! I think it was already defined like this in the example you sent. I'm having some issues now with the length of some of the macro variables but I'm very happy with this solution, it would have saved me a lot of time I I had known earlier so thanks again!

Tom
Super User Tom
Super User

@bouz22 wrote:

Thank you, this is very helpful! It works, now I have to think a bit about how to integrate this into my existing macro's but I will work something out. The csv files I am creating on the server, is there a way for me to delete these at the end of the process? I can imagine the IT department will not be too happy if I leave all these files on their server.


Get them to help you setup a more reasonable process.  For example they could mount a network attached disk volume to the SAS server(s) so you could just write the files directly into the place where you need them.  Or grant SFTP access to the machine where you need to place the files so your program could copy them there. Or many other methods.

bouz22
Calcite | Level 5

Unfortunately this most likely won't work, I work at a hospital with very inflexible IT department. I probably shouldn't say here 😉but I would much rather have the data provided in SQL Server so I can use R or Python to access the tables, however the hospital forces me to use Sas EG because there is no other way to access the data. Works for 90% of the people working with the data I suppose but not really for me...

Tom
Super User Tom
Super User

If you can connect to a SAS server using Enterprise Guide then you should be able to connect to that same server using the SASPY package in Python.

bouz22
Calcite | Level 5
I have looked into the SASPY package a while ago but never managed to get it to work, also within our IT department there was no one who could help me out unfortunately...

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 10 replies
  • 983 views
  • 1 like
  • 3 in conversation