Open In App

SAS | COALESCE Function with Examples

The COALESCE function is employed to pick the first non-missing value in a list of variables. In other words, it returns the first non-blank value of each row.

Let’s produce a sample dataset in SAS to know how COALESCE perform.



Example:




data temp;
    input roll_no a1-a4;
    cards;12 . 98 52 . 
        23 79 . 67 . 
        14 90 82 88 85 
;run;

Output:




Article Tags :