Hi there,
I've just encountered a very strange behavior of SAS when performing an import.
After succesfuly importing the first file, after a while I had to change it due to updates but when the source file was changed performing the same import on the same table generated a "NOTE: Import cancelled. Output dataset WORK.NTB already exists. Specify REPLACE option to overwrite it." and the script continued without a problem as nothing important had happend although the entire analysis was peformed on the old data.
How is it possible to throw a NOTE instead of an ERROR (or even an Warning) in such situations? Is this the normal behavior of SAS? because I find it very odd and I cannot imagine a single situation where such outcome it's desirable. Basically if you forgot to mention the "replace" options SAS doen't think it's a critical situation and makes you think everything was fine.
Thank you for your help.
EG version 7.15 HF7, SAS 9.4
You might want to address you concerns to SAS technical support, where the information might reach the right decision makers. We here in the SAS Communities aren't really the right people to address this issue to; we can't make any changes based upon your concerns.
You might want to address you concerns to SAS technical support, where the information might reach the right decision makers. We here in the SAS Communities aren't really the right people to address this issue to; we can't make any changes based upon your concerns.
It seems to be pretty clear to me. You asked IMPORT to create a dataset, but that dataset already exists so the PROC did nothing.
If you want it to automatically delete the existing dataset the add the REPLACE keyword to the PROC IMPORT statement.
SAS is a hodge-podge of many different programs built up over the years by multiple teams of programmers. It is best to just understand how it works and not worry too much about trying to understand what decisions the various design teams have made over the years.
Conditionally delete the dataset before the import:
%if %sysfunc(exist(ntb)) %then %do;
proc delete data=ntb;
run;
%end;
But you're right. That should cause a WARNING in my opinion.
Thank you all for your help.
I’m happy to inform you that this behavior has been submited to SAS and has been accepted by R&D / product management and message will be re-classified from NOTE to ERROR.
Somewhere in the future 🙂
Cheers
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!
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.