BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Using the label option in proc print seems easy enough but my attempts to do so silently fail (no error message in the log). The code is basically this:

proc print data=peopletolist n noobs;
title'participants with incomplete records';
var lname fname id_num region ispo_cd group;
label lname='Last Name'
fname='First Name'
id_num='ISP Number'
region='Region'
ispo_cd='Officer'
group='Status';
run;

Output does not use the specified label for each column but instead keeps using the name of the variable as the column header. Why?
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
This is the documented behavior. As is says here:
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001292467.htm

By default, SAS uses variable names for column headings.


Even if you have a LABEL statement in your PROC PRINT step, you must -turn on- the use of those labels with the LABEL option (or with the SPLIT= option, which requires the use of the variable labels).

See the specific documentation here:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a002291718.htm#a003186152 (LABEL)http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a002291718.htm#a003186154 (SPLIT)

cynthia
deleted_user
Not applicable
> Even if you have a LABEL statement in your PROC PRINT
> step, you must -turn on- the use of those labels with
> the LABEL option (or with the SPLIT= option, which
> requires the use of the variable labels).

Thank you, that was very helpful.
The docs I was working from did not make that clear.

Thanks.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 664 views
  • 0 likes
  • 2 in conversation