SAS Component Language Dictionary |
Category: | Utility |
Syntax |
sysrc=RENAME(old-name,new-name<,type<,description<,generation<,password>>>>); |
contains the return code for the operation:
0 | |
0 |
is the current name of a member of a SAS data library, an external file, or an external directory. For a member, this can be a one-, two-, or four-level name. For an external file or a directory, old-name must be the full pathname of the file or a directory; otherwise, the current directory is used.
is the new one-level name for the library member, external file, or directory.
is the description of a catalog entry. You can specify description only when type is CATALOG.
is the generation number of the data set that is being renamed.
Details |
You can use RENAME to rename files or directories that are external to a SAS session as well as members of a SAS data library.
To rename an entry in a catalog, specify the four-level name for old-name and a one-level name for new-name. You must specify CATALOG for type when renaming an entry in a catalog.
Mainframe Usage of RENAME |
RENAME works on directory-based operating systems only. RENAME was not designed for mainframe operating systems, and will produce the following error:
ERROR: Requested function is not supported.
To rename external files or directories on a mainframe, use the host command for renaming files in conjunction with the SYSTEM function. For example, on MVS you could use the following:
rc=system("rename 'userid.old.lib' 'userid.new.lib'");
Examples |
Rename a SAS table from DATA1 to DATA2. Also rename a catalog entry from A.SCL to B.SCL.
rc1=rename('mylib.data1','data2'); rc2=rename('mylib.mycat.a.scl','b','catalog');
/* rename a file that is in another directory */ rc=rename('/local/u/testdir/first', '/local/u/second','file'); /* rename a PC file */ rc=rename('d:\temp','d:\testfile','file');
rc=rename('/local/u/testdir/','/local/u/oldtestdir','file');
Rename a generation of the data set work.one to work.two , where the password for work.one#003 is "joyful":
rc=rename('work.one','two','data',",'joyful',3);
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.