Thank you for your help. Now that I have that done is there a macro in which i ould be able to minimize repeating the same step but with different datasets. As shown below after the macro is created the same macor is applied to 3 different datasets. I would like to further minimize repetition. %macro try; if newrace= '4' then newrace2 = '1. Black'; if newrace= '1' then newrace2= '2. Hispanic'; if newrace= '6' then newrace2= '3. White'; if newrace in ('3', '5', '7', '2', '8', '9', ' ') then newrace2= '4. API &Other'; if 0 le livingage&year. le 24 then livingage_new&year.='0-24'; if 25 le livingage&year. le 34 then livingage_new&year.='25-34'; if 35 le livingage&year. le 44 then livingage_new&year.='35-44'; if 45 le livingage&year. le 54 then livingage_new&year.='45-54'; if 55 le livingage&year. then livingage_new&year.='55+'; %mend try; data estab0_demo2; length newrace2 $13.; length livingage_new&year $13.; set estab1_demo; %try; run; data estab1_demo2; length newrace2 $13.; length livingage_new&year $13.; set estab1_demo; %try; run; data nr_demo2; length newrace2 $13.; length livingage_new&year $13.; set nr_demo; %try; run;
... View more