Chapter 38
Modifying SAS Data Set Names
and Variable Attributes
Introduction to Modifying SAS Data Set Names and Variable Attributes . . . . . . 713
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
Input Data Library for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
Renaming SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
Modifying Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
Understanding How to Modify Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . 716
Renaming Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
Assigning, Changing, or Removing Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
Assigning, Changing, or Removing Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
DATASETS Procedure Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
Introduction to Modifying SAS Data Set Names
and Variable Attributes
Purpose
SAS enables you to modify data set names and variable attributes without creating new
data sets. In this section, you will learn how to use statements in the DATASETS
procedure to perform the following tasks:
• rename data sets
• rename variables
• modify variable formats
• modify variable labels
This section focuses on using the DATASETS procedure to modify data sets. However,
you can also use some of the illustrated statements and options to modify other types of
SAS files.
713