x cd /pub/data/acs2010/Tools; %let pgm=geos_by_sumlev; filename pgm "&pgm..sas"; *---Look at the ID variabales by SumLev for the usmcdcprofiles5yr data sets, this year and last (2010 and 2009 vintage). John Blodgett, OSEDA, under contract with the Missouri Census Data Center. November, 2011. ---*; %libname(acs2010); ods pdf file="&pgm..pdf"; title "&pgm - from acs2010/Tools with Output to temp.&pgm"; footnote "Geocome='00' Filter Applied to Input Dataset acs2010.usmcdcprofiles5yr"; libname temp '/pub/data/temp'; libname user '/SAS_temp/userb'; proc sort data=acs2010.usmcdcprofiles5yr(keep=_character_ TotPop DateCreated drop=geocomp_name ) out=idvars; by sumlev; where geocomp='00'; run; options linesize=240 nocenter; proc means data=idvars n sum; class sumlev; format sumlev $slvlwc.; var totpop; run; data temp.&pgm; length areaname $32; format areaname ; set idvars; by sumlev; if first.sumlev then n=0; n+1; if n <= 3; *---we keep the first 3 for each level---; drop n; run; ods output close; proc print data=temp.&pgm; by sumlev; id sumlev; title2 "ID variables by Summary Level on the acs2010.usmcdcprofiles5yr Dataset"; run;