Note: You cannot use the DATASETS procedure to change the values of observations,
to create or delete variables, or to change the type or length of variables. These
modifications are done with DATA step statements and functions.
Before using this section, you should understand the concepts presented in the following
• Chapter 35, “Understanding SAS Libraries,” on page 687
• Chapter 36, “Managing SAS Libraries,” on page 695
• Chapter 37, “Getting Information about Your SAS Data Sets,” on page 701
Input Data Library for Examples
The examples in this section use a SAS library that contains information about the
climate of the United States. The DATA steps that create the data sets in the SAS library
are shown in “The CLIMATE, PRECIP, and STORM Data Sets” on page 820.
Renaming SAS Data Sets
Renaming data sets is often required for effective library management. For example, you
might rename a data set when you archive it or when you add new data values.
Use the CHANGE statement in the DATASETS procedure to rename one or more data
sets in the same library. Here is the syntax for the CHANGE statement:
specifies the current name of the SAS data set.
specifies the name that you want to give the data set.
This example renames two data sets in the SAS library USCLIM, which contains
information about the climate of the United States. The following program starts the
DATASETS procedure. It then changes the name of the data set HIGHTEMP to
USHIGH and the name of the data set LOWTEMP to USLOW:
libname usclim 'SAS-library';
proc datasets library=usclim;
change hightemp=ushigh lowtemp=uslow;
714 Chapter 38 • Modifying SAS Data Set Names and Variable Attributes