x cd /pub/data/pl942000/Tools; %let pgm=nonplace_pops; filename pgm "&pgm..sas"; /* ----Adapted from unincorporated_pops.sas setup. That one generate a report showing persons by county in uninc. areas. This one generate a CSV file with pops not in places (cdp pops are excluded this time)._ John Blodgett, OSEDA, U. of Missouri Outreach & Extension. April, 2001. ---- */ *--Running for Wisconsin and Iowa, per req. from EJC/DH, 5-7-01---------*; options nodate linesize=100 pagesize=120 formdlim='=' noovp; libname user '/SAS_temp/user'; filename dlmout "/pub/data/temp/placepop.csv"; %libname (pl942000); /*<=========================Comment out===================================== data aggin; **** set pl942000.mosums(keep=sumlev county totpop placefp placecc); set pl942000.iasums(keep=sumlev state county totpop placefp placecc) pl942000.wisums(keep=sumlev state county totpop placefp placecc); where sumlev='740' and totpop; state=substr(county,1,2); *--should not be necessary but somehow we were getting some blanks here (??)--; if placefp='99999' then nonplace=totpop; else inplace=totpop; if placefp ne '99999' and placecc=:'U' then cdppop=totpop; run; %agg(aggout=aggout,aggby=county,aggvars=totpop nonplace inplace cdppop,idvars=state,dropvars=_nag_ _lvl_); ===========================End commented out================================ */ data report; set aggout; pctinplace=100*inplace/totpop; if cdppop=. then cdppop=0; label totpop='Total/Population' nonplace='Population/ in Unincorporated/Areas' inplace='Population/ in Incorporated/Areas' pctinplace='% Population/in Incorporated/Areas'; format pctinplace 5.1 totpop inplace nonplace comma11. cdppop comma9.; run; proc print split='/' label uniform noobs data=report; by state; label state='State'; format state $state.; format county $county.; sum totpop inplace nonplace cdppop; var county totpop inplace nonplace pctinplace cdppop ; * title 'Special Report: Missouri Counties Broken Down by In-Place Population, 2000 Census'; title 'Special Report: Iowa and Wisconsin Counties Broken Down by In-Place Population, 2000 Census'; run; %cnvtdlm(setin=report, names=0,varlabs=1,round=(.1))