What is the SAS proc sql equivalent of the oracle function is null that accepts two parameters the column you are checking and the value to use when null. I found a reference to ifnull() function but when I tried it I got an error. Maybe it's a simple syntax thing.
COALESCE() for numeric variables. (e.g. coalesce(numeric_var, 0) )
COALESCEC() for character variables. (e.g. coalescec(char_var, 'abc') )
COALESCE() for numeric variables. (e.g. coalesce(numeric_var, 0) )
COALESCEC() for character variables. (e.g. coalescec(char_var, 'abc') )
IFNULL in SAS as far as I know is restricted to FEDSQL use and not for Proc SQL.
The Coalesce functions as @mklangley references will return the left most non-missing value of a list of variables or values (3,4,5 or more) so may be more flexible.
Coalescec (var1, var2,var3,'result') would 'result' if all of var1 through 3 were missing (or null for those who haven't quite mastered the SAS jargon yet).
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.