x cd /pub/data/popests/Tools; %let pgm=usgqhhpopsYY; filename pgm "&pgm..sas"; /*----Create popests.usgqhhpops&yr, with just the latest group quarters and household pop counts along with the corresponding figures from the 2k census. For all US states and Counties. Initial coding, 8/2006 by John Blodgett, Missouri Census Data Center. Modified 6/2014 to run with 2013 vintage estimates (new decade!) Running with 2015 vintage ests 3-16. ------*/ %let year=2015; *<=================EDIT EACH TIME=============; %let yr=%substr(&year,3,2); %let temp=; *<-------------set to null to write output directly to popests data directory---; libname popests "/pub/data/popests/&temp"; data popests.usgqhhpops&yr(label="US Pop Estimates with Household Pop and GQ Pops 2010-&year"); set popests.uscom&yr(keep=sumlev state stab areaname county gqpopc gqpop popest Popcen10 Pop10C ); **rename=(gqpopJL&yr=GQPopEst)); *---We create variables for the Group Quarters and Households pop for the latest estimate year and for 2000 using the "estimates base", or corrected figures. ---*; HHPop=popest-GQpop; HHPop10C=Pop10C-gqpopc; GQPopChang=gqpop - GQpopc; HHPopChang=HHpop - HHPop10C; label gqpopc='Grp Qtrs Pop Ests Base' gqpop="Grp Qtrs Est 7/&year"; label HHPop="Household Pop Est 7/&year" HHPop10C="Household Pop 2010 Estimates Base" GQPopChang="Change in Grp Qtrs Pop, 2010-&year" HHPopChang="Change in Household Pop, 2010-&year"; format hhpop hhPop10C comma9. gqpopchang comma7. hhpopchang comma9. ; rename gqpop=GQPopEst; run; proc print data=popests.usgqhhpops&yr(obs=10); title2 "Partial listing of popests.usgqhhpops&yr"; run; *---generate a report for the popests report library as pdf file---; ods pdf file="/pub/data/popests/Reports/usgqhhpops&yr..pdf"; options nodate; ods listing close; *<---uncomment for final run-----; proc print data=popests.usgqhhpops&yr label; by state; *** where state='10'; *<========================test run==================; id areaname; var county popest HHpop GQpopest Pop10C hhPop10C gqpopc hhpopchang gqpopchang; label state='State' county='County FIPS' ; format state $state. county $5. ; title "Trends in Population: Household Vs. Group Quarters, 2010 Census to July, &year Estimates"; title2 "All US States and Counties"; footnote "Report Produced by Missouri Census Data Center on &sysdate"; footnote2 "Data for Report is in popests.usgqhhpops&yr, Accessible Via Uexplore/Dexter"; run; ods pdf close;