BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ronein
Meteorite | Level 14

Hello

I want to see a code that delete a data set if the data set exists.

When I run the following code for a data set that doesn't exist then I get warning. 

WARNING: File work.XX.DATA does not exist.

 

proc delete data=XX;Run;

 

1 ACCEPTED SOLUTION
4 REPLIES 4
Ksharp
Super User
Write some dummy code before PROC DELETE ?

data xx;xx=1;run;
proc delete data=XX;Run;
ballardw
Super User

Proc datasets with the NOWARN and NODETAILS options.

AllanBowe
Barite | Level 11
The following macro can be used to remove multiple tables without warnings if they don't exist, it will also work just the same for views (so you don't need to test for that either):

https://core.sasjs.io/mp__dropmembers_8sas.html

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 5783 views
  • 7 likes
  • 5 in conversation