/ Published in: SAS
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
options missing=''; Data mydata; input ID v1 v2 v3 v4; combvar=input(substr(cats(v1,v2,v3,v4),1,1),best.); datalines; 15 0 . 1 0 16 1 0 0 0 17 0 1 0 0 18 . . 0 0 ; run; proc print; run; ID v1 v2 v3 v4 combvar 15 0 . 1 0 0 16 1 0 0 0 1 17 0 1 0 0 0 18 . 0 0 0 0