tags:

views:

103

answers:

2

Hi,

Can anyone tell me what is the fastest way to programmatically convert a SAS dataset into a CSV file. I know I can use a data step and output to a file etc. But is that the only way?

Thanks, Adnan.

+2  A: 

something along these lines?

proc export data=sashelp.class
    outfile='c:\temp\sashelp class.csv'
    dbms=csv
    replace;
run;
rkoopmann
Yes that was one of the options we'd discussed. Do you know how it scales vs the data step approach?
Adnan
based on the log, proc export generates a data null step to write out the text file. so i'd guess using a data step from the start would be more efficient in terms of cpu time. data step would give you more control over the output.
rkoopmann
I'm probably going to end up using a data _null_ anyway because I'd like to have control over which columns get exported, and things iike formatting/not formatting column values etc.
Adnan
+1  A: 

5 different ways to create .CSV file of a SAS dataset.

refer http://studysas.blogspot.com/2009/02/how-to-create-comma-separated-file-csv.html

sarath