Good Afternoon,
I have a dataset that I am trying to export to a .csv file. I am using SAS 9. See below
PROC EXPORT DATA=ASJ2;
OUTFILE='c:\Users\jmitchel\Documents\ASJ2_Test.csv';
DBMS=CSV
RUN;
I get the following error.
ERROR: FILE= OR TABLE= is required and must be specified.
What is causing this error?
You have and extra semi-colon. It is ending the PROC statement too soon.
I find that it really helps when you have a multi-line statement to place the ending semi-colon on a new line. Like you would do with an END statement.
PROC EXPORT
DATA=ASJ2
OUTFILE='c:\Users\jmitchel\Documents\ASJ2_Test.csv'
DBMS=CSV
;
RUN;
Thank You!
Hi,
I'm getting a similar error ( ERROR: FILE= or TABLE= is required and must be specified.), but I believe my ; are correct already
My code is:
proc export data=_temp1.bladder;
outfile=/home/u59515136/Jakob/bladder.xlsx;
dbms=xlsx replace;
run;
Because you have the exact same syntax error as the original post. You have inserted semi-colons that end the PROC STATEMENT too soon.
But you also have another error. You also have not quoted the physical pathname.
proc export data=_temp1.bladder
outfile="/home/u59515136/Jakob/bladder.xlsx"
dbms=xlsx replace
;
run;
Thanks! Is the physical path name the location of the file in FILES (HOME)? where do I paste that in the code please
Since you are using PROC EXPORT the file does not have to exist before the PROC runs. The PROC will write it.
If you are using some interface to run your SAS code, like SAS/Studio, then the path has to one that is valid on the machine where SAS itself is running. You can check the properties of an existing file in your HOME folder and see how the path should be specified. Yes you can copy and paste the path as displayed by the properties tab in SAS/studio into your code to make sure you have typed it correctly.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.