UMASS Department of:
Biostatistics and Epidemiology

SAS:The Statistical Analysis System
Basics
Combo
Desc Stats
Advanced
Index
SASHome
Intro
Data In
Data Out
Pretty
Cleaning
Documentation
Environs
Basics: Making a data set easy to understand, and producing pretty results
Including descriptive names for variables as LABELS.


Introduction

We illustrate how to make column heading easy to understand using a LABEL statement in a SAS DATA step. The illustrations use data read by a simple SAS program that consists of a portion of the full data from a study of Intensive Care.

Task

Result

SAS Keywords/Code

Detail

a. Adding Descriptive Labels to variables

1a1, 1a2

DATA d; LABEL ...

detail

b. Dividing Labels by Lines

Table 1b.

PROC PRINT SPLIT="/";

detail

c. Removing Labels

Table 1c.

DATA d; LABEL=" ";

 

 

 


Detail for

Result

SAS Keywords/Code

Detail

a. Adding Descriptive Labels to variables

1a1, 1a2

DATA d; LABEL ...

  • Labels are a maximum of 40 characters/blanks.
  • Include SAS variable name as last part of LABEL
  • The option LABEL (or SPLIT="/") is needed for LABELS to be used in PROC PRINT.
  • Labels will be printed on separate lines with breaks at blanks.


 

 

 

Detail for

Result

SAS Keywords/Code

Detail

b. Dividing Labels by Lines

Table 1b

PROC PRINT SPLIT="/";..

  • Use a special character in the LABEL statement (either / or *)
  • Include SAS variable name as last part of LABEL
  • Identify the special character with a SPLIT ="/" options in PROC PRINT



Last Update: 10/5/98
Comments: Ed Stanek
Email:
stanek@schoolph.umass.edu
\ed\web\be691f\webready\sbpret1.html