I’m having a problem with missing values and columns.
I want to create another column using the two existing columns – ed1 and ed2 to create ed3.
This following does not work. Should I use . to represent a missing value? Can I create another column this way? What am I doing wrong? Thank you for your assistance.
Proc sql;
Select id, ed1, ed2,
Case
When ed1 is null then ed2
When ed2 is null then ed1
When ed1 >= ed2 then ed1
When ed2 > ed1 then ed2
Else null
End as ed3;
Quit;
I want to create another column using the two existing columns – ed1 and ed2 to create ed3.
This following does not work. Should I use . to represent a missing value? Can I create another column this way? What am I doing wrong? Thank you for your assistance.
Proc sql;
Select id, ed1, ed2,
Case
When ed1 is null then ed2
When ed2 is null then ed1
When ed1 >= ed2 then ed1
When ed2 > ed1 then ed2
Else null
End as ed3;
Quit;