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!
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;
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.
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?
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.