5# sophia323
ifn(condition,result_if_true,result_if_false
[,result_if_missing])
Returns a numeric value based on whether a condition is true,
false, or missing. condition is a logical expression that evalu-
ates to true if it’s not zero or not missing. If result_if_missing is
omitted, result_if_false is returned if condition evaluates to
missing. Example: The statement
bonus=ifn(sales>500,10000,0);
is equivalent to
if sales>500 then bonus=10000; else bonus=0;
ifc(condition,result_if_true,result_if_false
[,result_if_missing])
Returns a character value based on whether a condition is true,
false, or missing. condition is a logical expression that evalu-
ates to true if it’s not zero or not missing. If result_if_missing is
omitted, result_if_false is returned if condition evaluates to
missing. Example: The statement
grade=ifc(score>60,'pass','fail');
is equivalent to
SAS FUNCTION