I want to export multiple SAS datasets as CSV files (not as xlsx files) using SAS 9.4. When using the code for any of the datasets:
proc export data = dataset
outfile = "C:\MBorg\dataset.csv"
dbms = csv replace;
run;
I receive this error message:
ERROR: Export unsuccessful. See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE EXPORT used (Total process time):
real time 0.06 seconds
cpu time 0.01 seconds
Contrary to what the error message suggests, the SAS log provides no extra details.
Folder permissions or having Excel closed or open when running the code as per this question's answer, or using an empty dataset, makes no difference. The SAS website mentions that this error can occur when using PROC EXPORT with DBMS=CSV, and it can be avoided by using name-literal syntax. However, using it as per below makes no difference.
proc export data = work.'dataset'n
outfile = "C:\MBorg\dataset.csv"
dbms = csv replace;
run;
Strangely the only way I can find to circumvent the problem is resetting SAS. options obs=max
makes no difference. Not sure what causes this message. This occurred with SAS 9.4 M0 and M7.
Any help with exporting CSV files without resetting SAS would be helpful.