I'd like to apply a label to nulls in a character variable.
I can do this quite fine with numeric variables, but am unsuccessful with character vars. I'd like to apply the label 'Both Groups' to the nul开发者_开发技巧l Group value (as created by the class
option in proc means
).
data group1;
input group $1. freq;
datalines;
A 5
B 8
13
;
proc format;
value $ grpfmt 'A' = 'Group A'
'B' = 'Group B'
'' = 'Both Groups'
;
run;
proc sql;
create table group2 as
select group format = $grpfmt.,freq
from group1;
quit;
Many thanks for any help.
Add space to the value of Both Groups, like
' ' = 'Both Groups'
Another way is to use the other option in the proc format.
other = 'Both Groups'
Just a wild guess...
did you try NULL = 'Both Groups' ?
精彩评论