I would like to write an error message to the SAS log if a variable in the input dataset does not exist. We are using a macro that differentially assigns a variable (datex) value based on another variable's value (var = site). If site is missing from the input dataset, a note will be added to the log (I think?) but I want to write a big red error message to let users know their input dataset is missing the 'site' variable. Any ideas? Thanks for the help!
ex:
data want;
set have;
%macro_to_create_datex;
run;
if variable site is not in the dataset have, then print an error to the log. The macro 'macro_to_create_datex' uses the value of 'site' to assign datex.