Previous Page | Next Page

The DATASETS Procedure

CHANGE Statement


Renames one or more SAS files in the same SAS library.
Featured in: Manipulating SAS Files

CHANGE old-name-1=new-name-1
<...old-name-n=new-name-n >
</ <ALTER=alter-password>
<GENNUM=ALL|integer>
<MEMTYPE=mtype>>;


Required Arguments

old-name=new-name

changes the name of a SAS file in the input data library. old-name must be the name of an existing SAS file in the input data library.

Featured in: Manipulating SAS Files

Options

ALTER=alter-password

provides the alter password for any alter-protected SAS files named in the CHANGE statement. Because a CHANGE statement changes the names of SAS files, you need alter access to use the CHANGE statement for new-name. You can use the option either in parentheses after the name of each SAS file or after a forward slash.

See also: Using Passwords with the DATASETS Procedure
GENNUM=ALL|integer

restricts processing for generation data sets. You can use the option either in parentheses after the name of each SAS file or after a forward slash. The following list shows valid values:

ALL | 0

refers to the base version and all historical versions of a generation group.

integer

refers to a specific version from a generation group. Specifying a positive number is an absolute reference to a specific generation number that is appended to a data set's name; that is, gennum=2 specifies MYDATA#002. Specifying a negative number is a relative reference to a historical version in relation to the base version, from the youngest to the oldest; that is, gennum=-1 refers to the youngest historical version.

For example, the following statements change the name of version A#003 to base B:

proc datasets;
   change A=B / gennum=3;

proc datasets;
   change A(gennum=3)=B;

The following CHANGE statement produces an error:

proc datasets;
   change A(gennum=3)=B(gennum=3);
See also:

Restricting Processing for Generation Data Sets

"Understanding Generation Data Sets" in SAS Language Reference: Concepts

MEMTYPE=mtype

restricts processing to one member type. You can use the option either in parentheses after the name of each SAS file or after a forward slash.

Aliases: MTYPE=, MT=
Default: If you do not specify MEMTYPE= in the PROC DATASETS statement, the default is MEMTYPE=ALL.
See also: Restricting Member Types for Processing

Details

Previous Page | Next Page | Top of Page