2
votes

I'm trying to export a large SAS file to csv. I used

proc export data=study1
    outfile='C:\Users\me\Documents\excel File\study1.csv'
    dbms=csv;
run;

I get the error:

ERROR: Physical file does not exist, C:\Users\Ingrid\Documents\excel File\study1.csv.

Why is it showing an error? I thought the outfile is arbitrary and will create a study1.csv when the proc is executed?

I also tried doing file>export data and got a csv file. bu when I tried to open it it says it's not actually a csv file, but an SYLK file.

I hope I can make the proc export work.

Thanks all

1
check and make sure the path you are using exists.scott
Yep. That error indicates that the folder you are referencing doesn't exist. Does "excel file" directory exist?Joe
Also, the SYLK file issue is irrelevant; it's really making a CSV file. Excel just gets confused. You likely have "ID" at the start of your file; see this KB article.Joe

1 Answers

1
votes

If the first record of your CSV file is “ID”, Excel will attempt to intepret the file as SYLK. Changing “ID” to anything else (including “Id” or “id”) fixes the issue.