BookmarkSubscribeRSS Feed
mancel3
Calcite | Level 5

Hi,

 

I have the code below: 

 

proc export data=Completed_CSV outfile="/locations/name.csv"
dbms=csv replace;
run;

 

It works perfectly and exports to the correct location on my server, but it is failing to display on my results page as I wish. Using ODS pdf has shown it in the results tab, but ods csv is impractically slow on this file for some reason. The file is too big to email from SAS  and I need to get it to my local desktop in order to upload the csv to a different software. I can view the CSV through the server's folder, but it opens in SAS and is not straightforward to save it to another location from there. Any advice on how to either get it to email out a file too large (I've tried zipping it and it wasnt working correctly) or to get it to display in results so that I can download it directly from there? Thanks!

5 REPLIES 5
Tom
Super User Tom
Super User

I don't understand what is it that you want to see in "RESULTS"?  Surely not the whole very large CSV file?

 

The fastest way to make a CSV file is to just use a data step and with DSD option on FILE statement and a PUT statement to write the data.  But PROC EXPORT basically just generates a data step anyway so the overhead of using PROC EXPORT is not that large.

 

Try using a fileref to tell SAS where the write the file so that you can create a ZIP file directly.  So something like:

filename csv zip "/locations/name.zip" member="name.csv" ;
proc export data=Completed_CSV outfile=csv dbms=csv replace;
run;

Or you could make a GZIP file instead of a ZIP file.

filename csv zip "/locations/name.csv.gz" gzip ;

If you want some "results" to look at try just dumping a few of the lines of the CSV back to the results window/destination.

data _null_;
  file print;
  infile csv obs=10;
  input;
  list;
run;

 

mancel3
Calcite | Level 5

Apologies for not explaining that very well, but no I want a physical file to display in the results, not the text of the csv. Here is an example of what I got to show up using ODS for and xls, where I can click on it and have it open immediately outside of the SAS interface. 

 

mancel3_0-1626376679318.png

 

 

Reeza
Super User
I don't think this is a programming question, you may want to talk to tech support here.
Tom
Super User Tom
Super User

There was a recent thread about some obscure poorly documented _dataout option in SAS/Studio.  I wonder if Enterprise Guide has some similar hidden trick for having your SAS code tell the caller (Enterprise Guide) what to do with the results?

Reeza
Super User
It sounds like you're exporting a CSV file and you'd like to put it somewhere else besides the "locations" location?

You can use ODS PACKAGE to zip the file directly via SAS.
If your zip file gets over 2GB you'll have issues.
What's your size limit and current file size?

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
  • 5 replies
  • 2301 views
  • 2 likes
  • 3 in conversation