Wednesday, June 8, 2011

COALESCE AND COALESCEC

COALESCE Returns the first non-missing value from a list of numeric arguments.
COALESCEC Returns the first non-missing value from a list of character arguments.

These functions can be used to substitute the Missing values.

Infact these functions can be more useful with the macro variables. Sometimes it is necessary to assign a value to the macro variable, this can be done inside the macro using a %If. However outside the macro
COALESCEC function can be used. Here is How.

%global myParameter; /* ensure it exists */

%let myParameter = %sysfunc(coalescec(&myParameter,default-value));