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!
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.
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.
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.
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.
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;
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!
@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.
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...
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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.