SAS Component Language Dictionary |
Category: | Utility |
Syntax | |
Details | |
Examples | |
Example 1: Deleting Tables and Catalog Entries | |
Example 2: Deleting Files | |
Example 3: Deleting Data Set Generations | |
See Also |
Syntax |
sysrc=DELETE(name<,type,<,password<,generation>>>); |
contains the return code for the operation:
0 | |
0 |
is the name of the member of the SAS data library or the physical pathname of an external file or directory. If a one-level name is specified for a SAS data library member, the library is assumed to be USER.
is the password that is assigned to the SAS table when type is DATA.
is the generation number of the SAS table that is being deleted.
Details |
DELETE attempts to delete the specified member and returns a value indicating whether the operation was successful. You can use DELETE to delete files or empty directories that are external to a SAS session, as well as members of a SAS data library.
Examples |
Delete the SAS table LIB1.MYDATA and the SAS catalog entry LIB2.CAT1.MYPROG.PROGRAM:
rc=delete('lib1.mydata'); rc=delete('lib2.cat1.myprog.program','catalog');
When deleting generation tables, if you delete the current (base) table without specifying the generation parameter, all tables in the generation group are deleted. For example:
rc=delete('one'); /* Deletes all tables in the generation group named 'one'*/
If you specify the current (base) table using the generation parameter, only that table is deleted. The youngest historical table becomes the new base. For example:
rc=delete('one','data',",0); /* Deletes only the table work.one (relative generation number=0) */
/* delete a file in a different directory */ rc=delete('/local/u/abcdef/testfile','file');
In Windows:
/* delete a file in a different directory */ rc=delete('D:\testfile','file');
Delete the third generation of a data set:
/* delete the third generation of the data set `work.one' */ rc=delete('work.one','data',",3);
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.