When using a hash object, if you misspell the variable in the find method and are using the return value, SAS does not produce any notes, warnings or errors in the log to let you know that you misspelled the variable. Below is a simple example that is supposed to produce a list of ids that are in both lists.
input id @@;
1234 9876 8888
input id @@;
* Create hash object *;
if _N_ = 1thendo;
declare hash list1 (dataset: 'work.list1');
* Keep only if it is in the hash object *;
if (0 EQ list1.find(key:idnum));
In the above example, the code has “idnum” instead of "id" on the next to last line. When run, the code fails to produce the desired result; instead of producing 1234, it produces no output. If you are writing a program that you expect will produce zero results most of the time, you may not notice this error. Of course we should all do a good job testing our code, producing test data to cover all scenarios, but people make mistakes and it would be nice if SAS helped to catch this particular mistake.
Rather than fail silently, I would suggest when an invalid variable name is supplied to the find function, SAS should produce a NOTE in the log. I would also like to see an option similar to mergenoby, where you can set the desired response (NOWARN, WARN, ERROR).