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
Diamond | Level 26
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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1004 views
  • 0 likes
  • 2 in conversation