![]() Chapter Contents |
![]() Previous |
![]() Next |
| DELETE |
| 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>>>); |
| 0 | successful |
0 |
not successful |
Type: Numeric
Type: Character
'ACCESS''CATALOG''DATA''VIEW''FILE'Type: Character
DATA.
Type: Character
Type: Numeric
| 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 an external file:
In UNIX:
/* 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 |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.