- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to export a sas table to excel but I want the columns labels to be printed instead of the column names. Does anyone know how to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Since there are several ways to create Excel related output you might share the code for what you used so we can suggest a compatible solution.
For example if you use Proc Export then your Proc Export statement should include the option LABEL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use the label option
https://support.sas.com/kb/41/735.html
proc export outfile='filename.xlsx' label dbms=xlsx replace; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Here is the code I am using:
PROC EXPORT DATA=data
OUTFILE="filepath\model.xlsx"
DBMS=Excel REPLACE label;
RUN;
but it doesn't print the excel table with the labels
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
PROC EXPORT DATA=data
OUTFILE="filepath\model.xlsx"
DBMS=XLSX REPLACE label;
RUN;
or Try
PROC EXPORT DATA=data
OUTFILE="filepath\model.xlsx"
DBMS=XLSX REPLACE;
label;
RUN;