Help using Base SAS procedures

proc print label option fails--why?

Reply
N/A
Posts: 0

proc print label option fails--why?

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?
SAS Super FREQ
Posts: 8,743

Re: proc print label option fails--why?

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
N/A
Posts: 0

Re: proc print label option fails--why?

> 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.
Ask a Question
Discussion stats
  • 2 replies
  • 104 views
  • 0 likes
  • 2 in conversation