New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
BookmarkSubscribeRSS Feed
marleeakerson
Calcite | Level 5

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?

4 REPLIES 4
ballardw
Super User

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.

ghosh
Barite | Level 11

Use the label option

https://support.sas.com/kb/41/735.html

proc export outfile='filename.xlsx' label dbms=xlsx replace; run;

 

marleeakerson
Calcite | Level 5

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

Ksharp
Super User

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;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1648 views
  • 1 like
  • 4 in conversation