Hi All,
I have a dataset with 140 variables, i need to concatinate all those variables and create a new variable(location) when the value is '1' with their labels. Below is the example:
DATA Have; INPUT VAR1 VAR2 VAR3 VAR4; label VAR1 = "loc1" VAR2 = "loc2" VAR3 = "loc3" VAR4 = "loc4" ; DATALINES; 0 0 0 0 0 1 0 0 1 1 1 1 1 1 0 1 1 0 1 0 0 0 0 1 1 0 0 0 ;
RUN;
New created column will be like this:
Location
loc2 loc1,loc2,loc3,loc4 loc1,loc2,loc4 loc1,loc3 loc4 loc1
Can you please guide me how this can be done efficiently.
Thanks, sasg.
... View more