- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way when using proc sql statements in PC SAS to export directly to excel? I'd like to be able to write queries in PC SAS to do this as easily as I can do a "Send To Excel" in Enterprise Guide.
Thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Simple answer, no. SQL is a query language, it is used for querying data, not for creating proprietary file formats. Simplest method is to proc export the resulting dataset, though I can't see your full process here, so unable to see where best it would fit in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Simple answer, no. SQL is a query language, it is used for querying data, not for creating proprietary file formats. Simplest method is to proc export the resulting dataset, though I can't see your full process here, so unable to see where best it would fit in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In PC SAS you can right click on a dataset and view in Excel.
If you have 9.4 then you can use ODS EXCEL.
Ods excel file='path';
proc sql...
ods excel close;
At the end of the day, I agree with @RW9 and you should use proc export. It's easier to manage outputs in long run IMO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try LIBNAME which is my favorite . libname xx xlsx '/folders/myfolders/want.xlsx'; proc sql; create table xx.class as select * from sashelp.class; quit;