When SAS encounters an uninitialized variable, it will output a note to the log that looks like this:
NOTE: Variable not_in_data is uninitialized.
Is it possible to have SAS output that message as a warning or an error instead?
When SAS encounters an uninitialized variable, it will output a note to the log that looks like this:
NOTE: Variable not_in_data is uninitialized.
Is it possible to have SAS output that message as a warning or an error instead?
Yes (in 9.4 or later):
option varinitchk = error;
Default value is
note
, other possible values arenonote
andwarning
.There is also undocumented feature that changes certain notes to errors. You can either set the option using
option dsoptions = note2err
; or by adding/ note2err
to a data statement. I found a list on SAS-L of the notes this option changes to errors:Source