BookmarkSubscribeRSS Feed
deleted_user
Not applicable
When I create a .csv file is there any way to have the Label put into the first line instead of the Var Name?
7 REPLIES 7
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
What SAS code are you using to create the CSV? For example, if you are using ODS CSV and combining that code with PROC PRINT, you can specify the LABEL parameter in PROC PRINT to use the LABEL instead of the variable name. If not using PROC PRINT, please share the SAS code you are using to generate the CSV.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
I'm not using ODS - just a simple Proc Export:

PROC EXPORT DATA= mdata.fnl_adam_mems
OUTFILE="c:mdata\fnl_adam_mems.csv"
DBMS=CSV REPLACE;
RUN;
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
After visiting the SAS support website http://support.sas.com/ I did a search using the argument "proc export label column" and one of the search results is the link below:

http://support.sas.com/kb/12/754.html

Scott Barry
SBBWorks, Inc.
data_null__
Jade | Level 19
[pre]
ods csv file='csvWithLabels.csv';
proc print label noobs data=sashelp.shoes(obs=20);
run;
ods csv close;
[/pre]
deleted_user
Not applicable
Hi Scott,

Thanks so much for your help. None of the Documentation I have included the LABEL parameter - how frustrating that the solution was so simple!

Liz
deleted_user
Not applicable
Apparently I spoke too soon. When I run the following Proc Export code I get an error message stating that the (LABEL) option is not recognized:
PROC EXPORT DATA=contents OUTFILE="S:\Mdata\contents.csv" DBMS=CSV REPLACE LABEL;
RUN;

What am I doing wrong?
deleted_user
Not applicable
I figured it out - we are using SAS 9.1.3 and LABEL will be available in 9.2

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!

Discussion stats
  • 7 replies
  • 905 views
  • 0 likes
  • 3 in conversation