If you have ever re-run the creation of a user-written function (proc ), you get a warning.
If you try to delete a user-written function that doesn't exist, you get a warning.
So, I came up with this macro that deletes the function if it exists in work.myfuncs.
%macro delete_function(function);
%if %sysfunc(exist(WORK.MYFUNCS)) %then %do;
PROC SQL noprint;
SELECT distinct _Key_ into :key
FROM WORK.MYFUNCS
WHERE _Key_ = "F.DATES.&function";
%if &sqlobs = 0 %then %return;
delete FROM WORK.MYFUNCS
WHERE _Key_ = "F.DATES.&function";
QUIT;
%end;
%mend delete_function;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.