Chapter Contents |
Previous |
Next |
RENAME |
Category: | Utility |
Syntax | |
Details | |
Examples | |
Example 1: Renaming Tables and Catalog Entries | |
Example 2: Renaming an External File | |
Example 3: Renaming a Directory | |
Example 4: Renaming a Data Set Generation | |
See Also |
Syntax |
sysrc=RENAME(old-name,new-name<,type<,description<,generation<,password>>>>); |
Type: Numeric
0 | successful |
0 | not successful |
Type: Character
Type: Character
Type: Character
'ACCESS'
'CATALOG'
'DATA'
'VIEW'
'FILE'
Type: Character
Type: Character
Type: Numeric
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.
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 an external file:
/* 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');
Rename a directory:
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 "blahblah":
rc=rename('work.one','two','data',",'blahblah',3);
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.