%*---This module creates the sf12010x defn for the MCDC extract to create the variables and align the dataset for metadata to be used as reference, create trends and datasets data files. Stored as module invoke_dovars.sas in the sf12010x/Tools directory. Using comparable setup in sf12000x/Tools as template. jgb, June, 2011 --; *--Revision History: Begin coding using the old module of same name for sf12000x: 6/22/2011 Minor mods 7/21/2011 9:09:00 AM 8/31/2011 Code for Chinese was wrong. Pointed to PCT517 (Sri Lankan). Also Other_Asian wrong by subtraction. 9/8/2011 Making all the format codes longer to allow 9-digit values at US level. 10/29/12: Adding new UrbanPop variable based on table P2, defined in the now-available UR version of sf1. --*; %let display=1; %let table=Total Population Trends, Etc.; %let universe=Total Population; %let RefTables=P1; %let lvl=0; %let pctof=; %dovar(TotPop,Total Population,P1i1,fmt=comma10.) %dovar(TotPop00,%str(Total Population 2000),totpop2k,fmt=comma10.,comment=%str(For tracts, bgs & blocks this variable estimated using 2k block level pops & blkrel10 to convert to 2010 geos (estimated). Other levels use 2000 SF1 data, thus based on 2000 boundaries.)) %let Pctof=TotPop00; %dovar(PopChange,%str(Change in Population 2000-2010),%str(totpop - totpop00),fmt=comma10. ,comment=Negative value indicates population loss.) %***dovar(PctPopChange,%str(Percent Change in Population 2000-2010),%str(popchange / totpop00 * 100),fmt=5.1); %*let display=0; %let Pctof=TotPop; %let RefTables=P12; %dovar(Male,Males,p12i2,fmt=comma10.) %dovar(Female,Females,p12i26,fmt=comma10.) %let RefTables=P2; %dovar(UrbanPop,Urban Pop,p2i2,fmt=comma10.,comment=Only available on UR versions of SF1) %let display=1; %let RefTables=; %let Pctof=; %dovar(PopPSqmi,Population Density,%str(totpop/landsqmi),fmt=5.1,comment=Uses land area in square miles as denominator,wtvar=landsqmi) %dovar(LandSqmi,Land Area Sq. Miles,landsqmi,fmt=comma9.) %let table=Age; %let universe=Population; %let RefTables=P12; %let lvl=2; %let pctof=TotPop; %dovar(Age0_4,Under 5 Years,%str(sum(of p12i3 p12i27)),fmt=comma10. ) %dovar(Age5_9,Age 5 to 9 Years,%str(sum(of p12i4 p12i28)),fmt=comma10. ) %dovar(Age10_14,10 to 14 Years,%str(sum(of p12i5 p12i29)),fmt=comma10. ) %dovar(Age15_17,15 to 17 Years,%str(sum(of p12i6 p12i30)),fmt=comma10. ) %dovar(Age18_19,18 to 19 Years,%str(sum(of p12i7 p12i31)),fmt=comma10. ) %dovar(Age20_24,20 to 24 Years,%str(sum(of p12i8-p12i10 p12i32-p12i34)),fmt=comma10. ) %dovar(Age25_34,25 to 34 Years,%str(sum(of p12i11 p12i12 p12i35 p12i36)),fmt=comma10. ) %dovar(Age35_44,35 to 44 Years,%str(sum(of p12i13 p12i14 p12i37 p12i38)),fmt=comma10. ) %dovar(Age45_54,45 to 54 Years,%str(sum(of p12i15 p12i16 p12i39 p12i40)),fmt=comma10. ) %dovar(Age55_59,55 to 59 Years,p12i17+p12i41,fmt=comma10. ) %dovar(Age60_64,Age60 to 64 Years,%str(sum(of p12i18 p12i19 p12i42 p12i43)),fmt=comma10. ) %dovar(Age65_74,65 to 74 Years,%str(sum(of p12i20 p12i21 p12i22 p12i44 p12i45 p12i46)),fmt=comma10. ) %dovar(Age75_84,75 to 84 Years,%str(sum(of p12i23 p12i24 p12i47 p12i48)),fmt=comma10. ) %dovar(Over85,85 Years and Over,%str(sum(of p12i25 p12i49)),fmt=comma10. ) %let RefTables=P13; %let pctof=; %let lvl=1; %let pctof=; %dovar(MedianAge,Median Age,p13i1,fmt=5.1,wtvar=totpop) %let RefTables=P12; %let lvl=2; %let pctof=TotPop; %dovar(Under18,Age 0 to 17,%str(sum(of age0_4 age5_9 age10_14 age15_17)),fmt=comma10. ) %dovar(Age18_24,18 to 24 Years,%str(sum(of Age18_19 Age20_24)),fmt=comma10. ) %dovar(Age25_44,25 to 44 Years,Age25_34+Age35_44,fmt=comma10. ) %dovar(Age45_64,45 to 64 Years,%str(sum(of Age45_54 Age55_59 Age60_64)),fmt=comma10. ) %dovar(Over62,62 Years and Over,%str(sum(of p12i19-p12i25 p12i43-p12i49)),fmt=comma10. ) %dovar(Over65,65 Years and Over,%str(sum(of Age65_74 Age75_84 Over85)),fmt=comma10. ) %let display=0; %dovar(Over18,18 & Over,%str(sum(of p12i7-p12i25 p12i31-p12i49)),fmt=comma10. ) %dovar(Over18_male,Males 18 & Over,%str(sum(of p12i7-p12i25)),fmt=comma10. ) %dovar(Over18_female,Females 18 & Over,%str(sum(of p12i31-p12i49)),fmt=comma10. ) %dovar(Over21,21 & Over,%str(sum(of p12i9-p12i25 p12i33-p12i49)),fmt=comma10. ) %dovar(Age15_19,15 to 19 Years,%str(sum(of p12i6 p12i7 p12i30 p12i31)),fmt=comma10. ) %dovar(Age18_24,18 to 24 Years,%str(sum(of p12i7-p12i10 p12i31-p12i34)),fmt=comma10. ) %dovar(Over65_male,Males 65 & Over,%str(sum(of p12i20-p12i25)),fmt=comma10. ) %dovar(Over65_female,Females 65 & Over,%str(sum(of p12i44-p12i49)),fmt=comma10. ) %let table=Race; %let universe=Population; %let RefTables=P3; %let lvl=0; %let pctof=TotPop; %let display=1; %dovar(One_Race_total,One Race,%str(p3i1-p3i8),fmt=comma10. ) %let lvl=2; %dovar(White1,White,p3i2,fmt=comma10. ) %dovar(Black1,Black or African American,p3i3,fmt=comma10. ) %dovar(Indian,American Indian and Alaska Native,p3i4,fmt=comma10. ) %dovar(Asian1,Asian,p3i5,fmt=comma10. ) %dovar(HawnPI1,Native Hawaiian and Other Pacific Islander,p3i6,fmt=comma10. ) %dovar(Other1,Some Other Race,p3i7,fmt=comma10. ) %dovar(MultRace,%str(Multi Race - Persons reporting more than one race),p3i8,fmt=comma10. ) %let display=0; * Race alone or in combination with one or more other races *; %let RefTables=P6; %dovar(White2,White alone or in comb w other race,p6i2,fmt=comma10. ) %dovar(Black2,Black or African American alone or in comb w other race,p6i3,fmt=comma10. ) %dovar(Indian2,%str(American Indian/Alaska Native alone or in comb w other race),p6i4,fmt=comma10. ) %dovar(Asian2,Asian alone or in comb w other race,p6i5,fmt=comma10. ) %dovar(Hawnpi2,%str(Native Hawaiian/Other Pacific Islndr alone or in comb w other race),p6i6,fmt=comma10. ) %dovar(Other2,Some Other Race alone or in combination,p6i7,fmt=comma10. ) %let display=0; %let RefTables=PCT8; %dovar(Hawaiian,Native Hawaiian,pct8i3,fmt=comma10. ) %dovar(Guam_or_Cham,Guamanian or Chamorro,pct8i8,fmt=comma10. ) %dovar(Samoan,Samoan,pct8i4,fmt=comma10. ) %let RefTables=P3; %dovar(Other_Pac_Islndr,Other Pacific Islander,%str(pct8i1 - sum(of pct8i3 pct8i8 pct8i4)),fmt=comma10. ) %let RefTables=PCT5; %dovar(Asian_indian,Asian Indian,pct5i2,fmt=comma10. ) %*!! 8-31-11; %dovar(Chinese,Chinese,pct5i7,fmt=comma10. ,comment=Excludes Taiwanese) %dovar(Filipino,Filipino,pct5i8,fmt=comma10. ) %dovar(Japanese,Japanese,pct5i11,fmt=comma10. ) %dovar(Korean,Korean,pct5i12,fmt=comma10. ) %dovar(Vietnamese,Vietnamese,pct5i20,fmt=comma10. ) %*!! 8-31-11; %dovar(OtherAsian,Other Asian,%str(pct5i1 - sum(of pct5i2 pct5i7 pct5i8 pct5i11 pct5i12 pct5i20)),fmt=comma10. ) %let table=Hispanic or Latino and Race; %let universe=Hispanic or Latino Population; %let RefTables=P4; %let lvl=0; %let pctof=TotPop; %let display=1; %dovar(HispPop,%str(Hispanic or Latino (of any race)),p4i3,fmt=comma10. ) %let lvl=2; %let reftables=pct11; %dovar(Mexican,Mexican,pct11i4,fmt=comma10. ) %dovar(PuertoRican,Puerto Rican,pct11i5,fmt=comma10. ) %dovar(Cuban,Cuban,pct11i6,fmt=comma10. ) %dovar(OtherHispanic,Other Hispanic or Latino,%str(pct11i3 -sum(of pct11i4 pct11i5 pct11i6)),fmt=comma10. ) %let lvl=0; %dovar(Non_Hispanic,Not Hispanic or Latino,p4i2,fmt=comma10. ) %let lvl=2; %let RefTables=P5; %dovar(White_Non_Hisp,White Alone Not Hispanic,p5i3,fmt=comma10. ) %let table=Relationship of Persons in Households; %let universe=Persons in Households; %let RefTables=P29; %let lvl=0; %let pctof=TotPop; %let display=1; %dovar(HHpop,Total Persons in Households,p29i2,fmt=comma10. ) %**let RefTables=P15; %let lvl=2; %dovar(Householder,Householder,p29i4+p29i19+p29i22,fmt=comma10. ) %let RefTables=P29; %dovar(Spouse,Spouse,p29i7,fmt=comma10. ) %dovar(Child,Child,sum(of p29i8-p29i10),fmt=comma10. ) %let RefTables=P31; %let lvl=3; %dovar(OwnChild_under18,Own Child Under 18 Years,p31i5,fmt=comma10. ) %let RefTables=P29; %let lvl=2; %dovar(Other_Relatives,Other Relatives,%str(sum(of p29i11- p29i16)),fmt=comma10. ) %let RefTables=P27; %let lvl=2; %dovar(Nonrelatives,Non Relatives,p29i17+p29i25,fmt=comma10. ) %let RefTables=P31; %let lvl=3; %dovar(NonreltvUnder18,%str(Non-rel Under 18),p31i13,fmt=comma10. ) %let RefTables=p34; %dovar(NonreltvOver65,%str(Non-rel Over 65),p34i11+p34i19,fmt=comma10. ) %let RefTables=PCT19; %let lvl=3; %dovar(UnmarriedPartner,Unmarried Partner,pct19i5+pct19i10,fmt=comma7. ) %let table=Households by Type; %let universe=Households; %let RefTables=P15; %let lvl=0; %let pctof=; %let display=1; %dovar(TotHHs,Total Households,p15i1,fmt=comma10. ) %let PctOf=tothhs; %let RefTables=P18; %let lvl=2; %dovar(Families,%str(Family Households (Families)),p18i2,fmt=comma10. ) %let lvl=3; %dovar(FamilyKidsLT18,With Own Children Under 18 Years,p19i8+p19i12+p19i15,fmt=comma10. ) %let lvl=2; %dovar(Married_Couple,Married Couple Family,p19i7,fmt=comma10. ) %let lvl=3; %dovar(MarrdCplKidsLT18,With Own Children Under 18 Years,p19i8,fmt=comma10. ) %let lvl=2; %dovar(FemaleHhldr,%str(Female householder, No Husband Present),p19i14,fmt=comma10. ) %let lvl=3; %dovar(SingleMoms,With Own Children Under 18 Years,p19i15,fmt=comma10. , comment=%str(Female-headed HHs, no husband present, w own children. May not be single, just not living with hubby.)) %let lvl=2; %dovar(NonFamily_HHs,Non Family Households,%str(p18i7),fmt=comma10. ) %let lvl=3; %let reftable=PCT15; %dovar(UnmPartnerHHs,Unmarried Partner Households,pct15i13,fmt=comma6.) %let lvl=4; %dovar(SameSexPrtnrHHs,Same-Sex Unmarried Partner HHs,pct15i14+pct15i24); %let lvl=3; %let reftable=P29; %dovar(LivingAlone,Householder Living Alone,p29i20+p29i23,fmt=comma10. ,comment=Universe is householders rather than persons) %let RefTables=P21; %dovar(HousehldrOver65,Householder 65 Years and Over,p21i17,fmt=comma10. ) %let RefTables=P20; %dovar(HHsIndvLT18,Households With Individuals Under 18 Years,p20i2,fmt=comma10. ) %let display=0; %let RefTables=P25; %dovar(HHsIndvOvr65,Households With Individuals 65 Years and Over,p25i2,fmt=comma10. ) %let PctOf=; %dovar(AvgHHoldSize,Average Household Size,p17i1,fmt=4.2,wtvar=tothhs) %dovar(AvgFamilySize,Average Family Size,p37i1, fmt=4.2,wtvar=family) %let table=Group Quarters; %let universe=Population Living in Group Quarters; %let RefTables=P42; %let lvl=0; %let pctof=TotPop; %let display=1; %dovar(GQpop,Population in Group Quarters,p42i1,fmt=comma10. ) %let lvl=2; %dovar(Institution_pop,Institutionalized Population,p42i2,fmt=comma10. ) %let lvl=3; %dovar(CorrectionalPop,Pop In Correctional Institutions,p42i3+p42i4,fmt=comma10. ) %dovar(NursingHomePop,Pop in Nursing Homes,p42i5,fmt=comma10. ) %dovar(OtherInstPop,Pop in Other Institutions,p42i6,fmt=comma10. ) %let lvl=2; %dovar(NonInstGQPop,NonInstitutionalized GQ Pop,p42i7,fmt=comma10. ) %let lvl=3; %dovar(CollegeDorms,%str(College Dormitories (Includes college quarters off campus)),p42i8,fmt=comma10. ) %dovar(MilitaryQtrs,Military Quarters,p42i9,fmt=comma10. ) %dovar(OthrNoninstGQPop,Other NonInstitutional GQ Pop,p42i10,fmt=comma10. ) %let table=Housing Occupancy and Tenure; %let universe=Housing Units; %let RefTables=H1; %let lvl=0; %let pctof=; %let display=1; %dovar(Tot_Units,Total Housing Units,h1i1,fmt=comma10. ) %let PctOf=tot_units; %let RefTables=H3; %let lvl=2; %dovar(Occupied_Units,Occupied Housing Units,h3i2,fmt=comma10. ) %let lvl=3; %let RefTables=H4; %let PctOf=Occupied_units; %dovar(OwnerOccupied,Owner Occupied,%str(h4i2+h4i3),fmt=comma10. ) %dovar(RenterOccupied,Renter Occupied,h4i4,fmt=comma10. ) %let lvl=2; %let RefTables=H5; %let PctOf=tot_units; %dovar(VacantUnits,Vacant Housing Units,h5i1,fmt=comma10. ) %let lvl=3; %dovar(VacantForRent,Vacant for Rent,h5i2,fmt=comma10. ) %dovar(VacantForSale,Vacant for Sale,h5i4,fmt=comma10. ) %dovar(Seasonal,%str(Vacant for Seasonal,Recreation or Occasional Use),h5i6,fmt=comma10. ) %let display=0; %let PctOf=tot_units; %dovar(OwnerTot,Total Owner Units incl Units for Sale,OwnerOccupied + vacantforsale,fmt=comma10. ) %dovar(RenterTot,Total Rental Units inc Units Vacant for Rent,RenterOccupied + vacantforrent,fmt=comma10. ) %let display=1; %let lvl=2; %let PctOf=; %dovar(OwnerVacrate,Homeowner Vacancy Rate,%str((vacantForSale/OwnerTot)*100),fmt=5.2,wtvar=OwnerTot) %dovar(RentalVacrate,Rental Vacancy Rate,%str((VacantForRent/RenterTot)*100),fmt=5.2,wtvar=RenterTot) *--new for 2010---; %let Reftab=H10; %let Pctof=TotPop; %dovar(PopInOwnerUnits,Pop in Owner-occupied Units,h11i2+h11i3,fmt=comma9.) %dovar(PopInRentedUnits,Pop in Rented Units,h11i4,fmt=comma9. ) %let RefTables=H12; %let PctOf=; %dovar(AvgSizeOwner,%str(Average Size of Owner-occupied Units),h12i2,fmt=5.2,wtvar=OwnerOccupied) %dovar(AvgSizeRenter,%str(Average Size of Renter-Occupied Units),h12i3,fmt=5.2,wtvar=RenterOccupied)