Deleting SAS Data Sets

Specifying Data Sets to Delete

Use the DELETE statement to delete one or more data sets from a SAS library. If you want to delete more than one data set, then list the names after the DELETE keyword with a blank space between the names. You can also use an abbreviated member list if applicable (such as YRDATA1-YRDATA5).
CAUTION:
SAS immediately deletes the files in a SAS library when the program statements are submitted.
You are not asked to verify the Delete operation before it begins, so make sure that you intend to delete the files before submitting the program.
For example, the following program specifies USCLIM as the procedure input library. It then deletes the data set RAIN from the library:
proc datasets library=usclim; ...

Get Step-by-Step Programming with Base SAS 9.4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.