10-17-2014 11:12 AM
I am stuck on creating a macro to loop through the values of 2 variables to recode into a new variable.
The logic looks like:
Variable 'Fruit' has values of 'Banana' 'Apple' 'Orange'
Variable 'Status' has values of 'Rotten' 'Fresh'
I would like to create the variable 'Fruit_Status' that is a concatenation of Fruit and Status, with values:
The basic logic where I can write out all combinations is:
IF Fruit="Banana' and Status='Rotten' THEN Fruit_Status=cat(Fruit," ",Status) ;
I imagine there is a much more elegant solution.
Thank you for your help!
Need further help from the community? Please ask a new question.