Hi there. How to refer to missing character variable values in a value statement (e.g. for Proc format)?
I have no trouble with using . = 'missing salary' when the variable is numeric ... But could not figure out a way to say: if the value for Gender is missing, format as 'Pls review'. I have tried just using '' but it did not work (no error msg / simply did not recode).
There's a difference between '' (quote quote) and ' ' (quote space quote) in the definition of a value to which a character format will apply. In addition with any user-defined format, you can use the keyword OTHER to "catch" all the values that do not fit into your categories.
The program below makes some data with missing values and bad values for the SEX variable from SASHELP.CLASS (using only a subset of rows). Consider the difference between using ' ' (quote space quote) in the format (report #1) and using OTHER in the format (report #2).
if age = 11 then sex = ' ';
if age = 16 then sex = 'Z';