BookmarkSubscribeRSS Feed
80sMetalForever
Calcite | Level 5

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.

4 REPLIES 4
Peter_C
Rhodochrosite | Level 12

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?

80sMetalForever
Calcite | Level 5

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.

Capture.JPG

nrose
Quartz | Level 8

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

80sMetalForever
Calcite | Level 5

sounds like it's just as you say...you need an actual dataset

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1948 views
  • 0 likes
  • 3 in conversation