/* adds the tablegroup and subjectgroup variables to the acs2006/profiles/variables dataset so that the acs2006 profiles can be in the order of demographic, economic, social, and housing */ *libname acs2006 '/pub/data/acs2006/profiles'; libname acs2006 '/pub/data/acs2006'; data variables; set acs2006.variables; length SubjectGroup $50; if TableNo >=1 and TableNo <=4 then do; TableGroup=1; * - demographic; SubjectGroup='Demographic'; end; if TableNo >=5 and TableNo <=14 then do; TableGroup=2; * - economic; SubjectGroup='Economic'; end; if TableNo >=15 and TableNo <= 29 then do; TableGroup=3; * - social; SubjectGroup='Social'; end; if TableNo >=30 and TableNo <=42 then do; TableGroup=4; * - housing; SubjectGroup='Housing'; end; run; data acs2006.variables; set variables; run;