You may want to invest time in some custom formats if you do a lot of this type of coding. Once you have the formats or informats created you can do a lot with things, sometimes without even creating new variables, for grouping variables. For instance I have codes that use clinic level identifiers to create regions or agency information. And if one of the clinics changes I only have to change that in the format and the new behavior is available at the next report time without changing the report code.
... View more