BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello
I want to export a data set with 2 million rows.
I want that the file we create will be compressed (ZIP)
I see that there was created a folder called "test.zip"  but there is no file inside

 

filename     _dataout    zip     "/path/test.zip";

proc export data=sashelp.cars
  outfile=_dataout
  dbms=csv replace;
run;
3 REPLIES 3
Tom
Super User Tom
Super User

You didn't tell SAS what name to give the file. Just which directory (zip file) you wanted to write the file.

Either add the MEMNAME= option to the FILENAME statement

filename _dataout zip "/path/test.zip" memname='cars.csv';

or leave the fileref pointing to the directory and tell PROC EXPORT what name to use within the directory.

outfile=_dataout('cars.csv')

 

Kurt_Bremser
Super User

When testing the OP code on SAS 9.4M6 on AIX and copying the .zip file to Windows, I got a single member called "test" (no extension) in the zip file when opened with 7zip. Opening the .zip with just the Windows Explorer it looked empty.

 

Bottom line: never trust a Microsoft tool to get it right.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 4987 views
  • 0 likes
  • 3 in conversation