Object already exists - Workaround to overwrite dataset in teradata

Analytics

Object already exists - Workaround to overwrite dataset in teradata

Hi,

I use SAS quite often and all my programs conenct to the teradata sql server to get the data. However, some of the programs also create files in the server.

The problem occurs when we run the same program again and teradata gives an error that the 'object already exisits'. Currently we use the following snippet to remove those datasets before the relevant step executes.

%local check ;
%let check=%sysfunc(exist(.));
%if &check=1 %then %do;
proc datasets lib=(;
delete ;
run;
%end;

However, this snippet works sometimes and doesn't work other times.

Is there any foolproof way of deleting the object? Better yet, is there any way of overwriting datasets in teradata? Like SAS does by default, when you run the same program again.

Thanks!

Tags (1)