Hi all,
suppose to have the following dataset:
data DB;
input ID :$20. City :$20. School :$20. Parents :$20.;
cards;
0001 0 0 0
0001 1 1 1
0004 1 0 0
0004 0 0 1
0004 0 0 0
0005 0 1 1
0006 1 0 0
0006 1 1 1
0006 1 1 0
....
;
I'm trying to merge all the variables to get the following:
data DB1;
input ID :$20. Index :$20.;
cards;
0001 0
0001 1
0004 1
0004 1
0004 0
0005 1
0006 1
0006 1
0006 1
....
;
The rule is: if there is at least one "1" in "City", "School", "Parents" then Index = 1 otherwise 0. I tried to use coalesce but it takes a lot of time because the variables to be collapsed are 10 but the rows are 30.000. Is there an alternative to do the job?
Thank you in advance.