SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

CSV file output

Reply
Contributor
Posts: 25

CSV file output

Hi,

I am trying to output a sas dataset into a CSV file using labels as the heades.

In the 9.1 version, if I use:

proc export data=...

                 outfile=...

                 dbms=scv replace;

I couldn't use labels as header.(I know there is a label option of proc export in 9.2 but unfortunately I am using 9.1 )

However, if I choose to use:

ods csv file=...

proc print ... label;

run;

ods csv close;

The out put quotes all data (char and numerical) which I really don't want.

Is there any way that I can output a csv file with labels as headline and no quotes in the output using version 9.1rc_?

Thanks,

Eric

Super User
Super User
Posts: 6,502

Re: CSV file output

Data _null_ already posted code for that to this thread.

https://communities.sas.com/message/18398#18398

Contributor
Posts: 25

Re: CSV file output

Thanks Tom, however my problem is actually have labels but no double quotation marks in my output using either proc export or ods csv + proc print.

Super User
Super User
Posts: 6,502

Re: CSV file output

Why would you want the double quotes unless there is a delimiter that needs quoting?

Do you have some system that has a specialized format that it requires?

Contributor
Posts: 25

Re: CSV file output

I DO NOT want the double quotes but when I use ods csv to output, SAS generate all double quotes in the output file automatically.

The problem could be simplified to:

how can I output a csv file with labels using proc export in 9.1. 

Super User
Super User
Posts: 6,502

Re: CSV file output

So don't use PROC EXPORT.  Use that data step code in the thread I referenced.

Ask a Question
Discussion stats
  • 5 replies
  • 3249 views
  • 3 likes
  • 2 in conversation