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:
is the current name of the SAS data set. new-name
is the name that you want to give the data set. This example renames two data sets in the SAS data library USCLIM, which contains information about the climate of the United States. The following program starts the DATASETS procedure, then changes the name of the data set HIGHTEMP to USHIGH and the name of the data set LOWTEMP to USLOW: options pagesize=60 linesize=80 nonumber nodate; libname usclim 'SAS-data-library';
proc datasets library=usclim; change hightemp=ushigh lowtemp=uslow; run;
Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!