Might be a simple answer to this but I'm not seeing it. When I perform a Proc SQL CREATE TABLE, I get a full drop-down menu for Export, including types such as .txt, .cvs, etc. However when just running a SELECT query I don't get those options, just .html or .lst based on the output types you have setup. So I sometimes do a create just so get the full export options. Is there a better way of doing this? Please note this is only for occasional quick hits on data, not something that lends itself to automation.
SELECT doesn't create external files (like csv files) it prepares (selects) columns.
Where these go depends on the rest of the query. When SELECT is not preceded by CREATE the result set is sent to default output controlled by ODS destination. - Unless the "into :mVarname " clause is present.
PROC SQL CREATE doesn't create csv-type files, only views or tables of the type appropriate to the libname to which the CREATE refers.
Where are you seeing these picking-lists?
After selecting Export from Output Data I'm presented with the full suite of export options. The main difference I see is you don't get 'Output Data' with a select query...you get 'Results...'
Would just be nice to be able to export right from a SELECT.
Hi,
Not sure of your requirements here, but the select statement produces a report output. Exporting to csv requires an actual dataset. Is there a reason why you are directly coding a select statement not using a create as well?
On the other hand, you can send a report to Excel if you have AMO installed.
Nick
sounds like it's just as you say...you need an actual dataset
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.