BookmarkSubscribeRSS Feed

PROC DELETE to remove SAS tables

Started ‎07-03-2018 by
Modified ‎01-09-2019 by
Views 84,971

Proc Delete is faster than either PROC DATASETS or PROC SQL.  Here are a few examples of how SAS programmers delete SAS tables.

 

 

proc delete data = libref.dataname;
run;

proc sql;
  drop table libref.dataname;
quit;

proc datasets library = libref;
  delete dataname;
run;

data _null_;
  length dd $8;
  rc = filename(dd,cats(pathname('libref'),'\dataname.sas7bdat'));
  rc = fdelete(dd);
  put _all_;
run;

 

 

 Since SAS 9.4, PROC DELETE has had more capabilities than ever -- find out more in Chris Hemedinger's blog.

 

This was originally posted by Ronald Fehd on sasCommunity.org.

Comments
RW9

I am sorry, but that coding is all over the place, upper case used, sometimes indents, unfinished blocks (e.g. missing run; after first proc.  Your other tips follow a coding standard?

Good points, @RW9.  We're moving some of the most popular posts from sasCommunity.org (now in stasis) to here, and these are coming over "as is" -- but I've fixed up this one.

Version history
Last update:
‎01-09-2019 12:28 PM
Updated by:
Super User

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Labels
Article Tags