BookmarkSubscribeRSS Feed
Nehcour0420
Calcite | Level 5

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

5 REPLIES 5
Tom
Super User Tom
Super User

Data _null_ already posted code for that to this thread.

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

Nehcour0420
Calcite | Level 5

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.

Tom
Super User Tom
Super User

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?

Nehcour0420
Calcite | Level 5

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. 

Tom
Super User Tom
Super User

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 4935 views
  • 3 likes
  • 2 in conversation