07-29-2015 04:14 PM
I'm trying to export a large data set to a .CSV format using the export option in SAS EG but it is taking a long time for me to export the data. Is there an alternative method to this?
The data set has 35740724 records.
07-30-2015 03:04 AM
Exporting through EG means that the export is done in SAS and the result is transferred to the client where EG runs. Depending on the layout of the .csv, you may simply be limited by the network data transfer rate.
PROC EXPORT will only utilize the workspace server locally and may be much faster on its own; it also shows you the data step it generated in the log, which you can use for further optimization.
Try to reduce the record size of your .csv if possible. You can also compress the .csv (eg with gzip) before using a file transfer tool to put the file where you need it.
07-30-2015 06:38 AM
The EG Export Menu transfers your data from the SAS Server to the EG client and then as much as I know uses client side .net functionality to create a .csv file. The bottleneck is normally the network when transferring the data. So that's a good solution for low volume once-off tasks.
For high volumes or repeated tasks you want to do this .csv file creation programatically on the Server. You can use Proc Export for this or there is also a SAS utility macro %DS2CSV available Base SAS(R) 9.4 Utilities: Reference
Be aware that when executing the task on the server you need to write the output (the .csv) to a location available to the Server (so it can't be your local C: drive).