they dont have sas access at work so i have to convert the file to csv before export it but i get errors
this is the code i am writing:
proc export data=mylib.susp_reasons_previous outfile= 'C:\Users\tiliev\Desktop\report.csv' replace;
sheet='susp_reasons_previous';run;
and this is the error i am getting:
1259 proc export data=mylib.susp_reasons_previous outfile= 'C:\Users\tiliev\Desktop\report.csv'
1259! replace;
NOTE: The previous statement has been deleted.
1260 sheet='susp_reasons_previous';
-----
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
Does anyone see what i am doing wrong here,pleasE?
I believe the sheet statement is only used with excel exports, not csv's.
I believe the sheet statement is only used with excel exports, not csv's.
hmm,
so any idea how to export csv files except through the wizard?
Hi,
Please try this
proc export data=mylib.susp_reasons_previous outfile= 'C:\Users\tiliev\Desktop\report.csv' dbms=csv replace;
sheet='susp_reasons_previous$';
run;
Thanks,
Jagadish
yea i did,still the same error.Probably "sheet" cant be used with csv as DBailey said
I agree, there is no way to name your sheetname when using CSV.
One work around it would be to name the file you are creating as the sheet-name.
For exmaple:
proc export data=mylib.susp_reasons_previous outfile= 'C:\Users\tiliev\Desktop\susp_reasons_previous.csv' replace;
sheet='susp_reasons_previous';run;
Good luck!
Anca.
thank you guys,
i do need all the query outputs to be on different worksheets of one excel file so i can have my table populated easily but i guess ODS
TAGSETS.EXCELXP would be the only way to do so?
but i cant export an excel file.I tried it before.We dont have sas access here
yeaa but that works too
Thanks for all your help Anca and team,
we dont have sas access to pc files but we have to ole db.Is there a way i can import/export excel files through it?
try this:
proc export data=mylib.susp_reasons_previous outfile= 'C:\Users\tiliev\Desktop\report.xls' dbms=csv replace;
run;
When you try to open the file with excel, you might get an error message that says the file is in a different format than the file extension, but if you click OK, excel should open the file.
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: