Desktop productivity for business analysts and programmers

Export to .cvs and others from SELECT?

Reply
Contributor
Posts: 39

Export to .cvs and others from SELECT?

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.

Valued Guide
Posts: 2,177

Re: Export to .cvs and others from SELECT?

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?

Contributor
Posts: 39

Re: Export to .cvs and others from SELECT?

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

Frequent Contributor
Posts: 91

Re: Export to .cvs and others from 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

Contributor
Posts: 39

Re: Export to .cvs and others from SELECT?

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

Ask a Question
Discussion stats
  • 4 replies
  • 280 views
  • 0 likes
  • 3 in conversation