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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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