Command Reference : Function Reference : Function Reference: R
  
 
@recode
Recode value by condition.
Returns if condition is non-zero (true); otherwise returns .
Syntax: @recode(s, x, y)
s: number
x: number or string
y: number or string
Return: number or string
Returns if is non-zero (true); otherwise returns .
Typically is specified using an expression with a boolean operator or function returning (0, 1) values (e.g., “z > 3”or “z > w”), but any argument providing (0, non-zero) values is sufficient.
Examples
= @recode(x<0, 1, 0)
returns 1 if x is negative, 0 otherwise.
Cross-references
See also @iif and @nan.