I have a data set with IDs like: 100101, 100102, 201201. The first two numbers indicate location, the second two numbers indicate a family group, and the last two numbers indicate the individual within that location and family group. I need to break these up into variables for the family. Right now I have this: data new; set original; if 100100<id<100200 then family=1; if 100200<id<100300 then family=2; if 100300<id<100400 then family=3; etc. run; I have 2,000 observations and hundreds of families so this method is going to take forever. I'm not very skilled at macros yet, is there a way I can code a macro to process this for me?
... View more