Return to Snippet

Revision: 32562
at September 29, 2010 02:55 by webonomic


Initial Code
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

Initial URL


Initial Description


Initial Title
Create a new variable based on the first non missing value from a list of variables

Initial Tags


Initial Language
SAS