- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Dear All,
Please can you help to provide how to create the Folders in SAS and Rename the folders using the code.
Many Thanks
Dhruva
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@dhruvakumar wrote:
Dear KurtBremser,
Thanks for advice.If you don't mind can you help one example ...Thanks
The documentation for each function has examples. Is there something unclear about them?
DCREATE()
https://documentation.sas.com/?docsetId=lefunctionsref&docsetTarget=p1aj29pf4cxnirn15q5hmf0tv438.htm...
data one; /* To create a new directory in the UNIX operating environment, using the name that is stored in the variable DirectoryName, follow this form: */ NewDirectory=dcreate(DirectoryName, '/local/u/abcdef/'); /* To create a new directory in the Windows operating environment, using the name that is stored in the variable DirectoryName, follow this form: */ NewDirectory=dcreate(DirectoryName, 'd:\testdir\'); run;
RENAME()
Example 1: Renaming Data Sets and Catalog Entries
The following examples rename a SAS data set from Data1 to Data2, and also rename a catalog entry from A.SCL to B.SCL.
rc1=rename('mylib.data1', 'data2');
rc2=rename('mylib.mycat.a.scl', 'b', 'catalog');
Example 2: Renaming an External File
The following examples rename external files.
/* Rename a file that is located in another directory. */
rc=rename('/local/u/testdir/first',
'/local/u/second', 'file');
/* Rename a PC file. */
rc=rename('d:\temp', 'd:\testfile', 'file');
Example 3: Renaming a Directory
The following example renames a directory in the UNIX operating environment.
rc=rename('/local/u/testdir/', '/local/u/oldtestdir', 'file');
Example 4: Renaming a Generation Data Set
The following example renames the generation data set Work.One to Work.Two, where the password for Work.One#003 is my-password.
rc=rename('work.one', 'two',,, 3,'my-password');
I highly suggest bookmarking this page, it's a good organization of functions organized by category
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you are talking about folders (directories) in the file system, look at the dcreate() and rename() functions.
If you are talking about SAS metadata folders, look at the METADATA procedure, but using it is NOT trivial.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Dear KurtBremser,
Thanks for advice.If you don't mind can you help one example ...Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@dhruvakumar wrote:
Dear KurtBremser,
Thanks for advice.If you don't mind can you help one example ...Thanks
The documentation for each function has examples. Is there something unclear about them?
DCREATE()
https://documentation.sas.com/?docsetId=lefunctionsref&docsetTarget=p1aj29pf4cxnirn15q5hmf0tv438.htm...
data one; /* To create a new directory in the UNIX operating environment, using the name that is stored in the variable DirectoryName, follow this form: */ NewDirectory=dcreate(DirectoryName, '/local/u/abcdef/'); /* To create a new directory in the Windows operating environment, using the name that is stored in the variable DirectoryName, follow this form: */ NewDirectory=dcreate(DirectoryName, 'd:\testdir\'); run;
RENAME()
Example 1: Renaming Data Sets and Catalog Entries
The following examples rename a SAS data set from Data1 to Data2, and also rename a catalog entry from A.SCL to B.SCL.
rc1=rename('mylib.data1', 'data2');
rc2=rename('mylib.mycat.a.scl', 'b', 'catalog');
Example 2: Renaming an External File
The following examples rename external files.
/* Rename a file that is located in another directory. */
rc=rename('/local/u/testdir/first',
'/local/u/second', 'file');
/* Rename a PC file. */
rc=rename('d:\temp', 'd:\testfile', 'file');
Example 3: Renaming a Directory
The following example renames a directory in the UNIX operating environment.
rc=rename('/local/u/testdir/', '/local/u/oldtestdir', 'file');
Example 4: Renaming a Generation Data Set
The following example renames the generation data set Work.One to Work.Two, where the password for Work.One#003 is my-password.
rc=rename('work.one', 'two',,, 3,'my-password');
I highly suggest bookmarking this page, it's a good organization of functions organized by category