x cd /pub/data/sf12000x/Tools; %let pgm=cnvt_sf12000x; filename pgm "&pgm..sas"; *--------------------OBSOLETE: SEE cnvt_moi module as replacement!!!!!---------------------*; *----Accesses a sf12000 (complete 2000 SF1) type data set and creates (1 or more) sf12000x standard extract files (as used in generating our DT2K-1 Demographic Trend Report 1: 1990-2000) data products. Shiva Kumar and John Blodgett, Initial coding June, 2001. Revision History: 6-28-01: Variable asian1 was labeled as "Asian only" but was in fact the sum of Asians and Pac Islanders. We change this so that they are really just Asians. 6-30-01: Making it a macro (doit) with more flexibility for specifying 1990 data options. 7-24-01: Adding zcta5 to list of geo variables to keep. ----*; options msglevel=i fullstimer; *--trying to get a handle on what is taking so long-----; libname sf12000 '/pub/data/census_2000/sf12000' access=readonly; libname sf12000x '/pub/data/sf12000x'; libname sf1 (sf12000); *--alternate libref--; libname sf1x (sf12000x); *--alternate libref--; %libname(sf1prof); %libname(stf901x2,opts=); *<---custom generated 1990 stf1 extract set ready to be merged with our sf2000x data set-; *libname user '/SAS_temp/user'; /* ******Specifications for this filetype******* 1. Very similar to the Census Bureau DT-1 Demographic Profile product (released as pdf and CSV files for govt. units in May, 2001. See filetype sf1prof. 2. All variable names should be the same as the corresponding items in data sets in the sf1prof datasets if they are present there. This data set is a superset of the sf1prof filetype. 3. Verify that output matches those published in DT-1 reports by Census Bureau. Very important that we be consistent with that product/standard. ******************************** */ *----Generate attrib statements describing the variables on an sf1prof data set. The resulting sas code will be included in the data step below.---; *filename attrib 'sf1prof_attrib.sas'; *genattr(setin=sf1prof.us,debug=1); *-------We bring in this file and edit in-line as part of the conversion data step.------; %macro doit(state,stab,set90=,iset=1,hset=0,bset=0,step1=1); %let ustab=%upcase(&stab); %if &step1 %then %do; %*<--For reruns specify step1=0 to avoid regenerating user._2000&stab data set; data _2000&stab; length default=5; length esriid $42.; merge sf1.&stab.geos sf1.&stab.phng sf1.&stab.pctng ; by geo_id; *---Attrib statement(s) generated by genattr macro---; Attrib TotPop length= 5 label='Total Persons' TotPop90 length=5 label='Total Pop 1990' Change length=4 label='Pop Change, 1990-2000' PctChange length=3 format=5.1 label='% Change in Pop 1990-2000' Male length= 5 label='Male' pct_Male length=3 format=5.1 label='% Male' Female length= 5 label='Female' pct_Female length=3 format=5.1 label='% Female' ; Attrib Age0_4 length= 5 label='Under 5 Yrs' pct_Age0_4 length=3 format=5.1 label='% Under 5 Yrs' Age5_9 length= 5 label='5 to 9' pct_Age5_9 length=3 format=5.1 label='% 5 to 9' Age10_14 length= 5 label='10 to 14' pct_Age10_14 length=3 format=5.1 label='% 10 to 14' Age15_19 length= 5 label='15 to 19' pct_Age15_19 length=3 format=5.1 label='% 15 to 19' Age15_17 length= 5 label='15 to 17' pct_Age15_17 length=3 format=5.1 label='% 15 to 17' Age18_19 length= 5 label='18 to 19' pct_Age18_19 length=3 format=5.1 label='% 18 to 19' Age18_24 length= 5 label='18 to 24' pct_Age18_24 length=3 format=5.1 label='% 18 to 24' Age20_24 length= 5 label='20 to 24' pct_Age20_24 length=3 format=5.1 label='% 20 to 24' Age25_44 length= 5 label='25 to 44' pct_Age25_44 length=3 format=5.1 label='% 25 to 44' Age45_64 length= 5 label='45 to 64' pct_Age45_64 length=3 format=5.1 label='% 45 to 64' Age25_34 length= 5 label='25 to 34' pct_Age25_34 length=3 format=5.1 label='% 25 to 34' Age35_44 length= 5 label='35 to 44' pct_Age35_44 length=3 format=5.1 label='% 35 to 44' Age45_54 length= 5 label='45 to 54' pct_Age45_54 length=3 format=5.1 label='% 45 to 54' Age55_59 length= 5 label='55 to 59' pct_Age55_59 length=3 format=5.1 label='% 55 to 59' Age60_64 length= 5 label='60 to 64' pct_Age60_64 length=3 format=5.1 label='% 60 to 64' ; Attrib Age65_74 length= 5 label='65 to 74' pct_Age65_74 length=3 format=5.1 label='% 65 to 74' Age75_84 length= 5 label='75 to 84' pct_Age75_84 length=3 format=5.1 label='% 75 to 84' Over85 length= 5 label='Over 85' pct_Over85 length=3 format=5.1 label='% Over 85' Median_Age length= 5 label='Median age' age17_down length= 5 label='17 and Under' pct_age17_down length=3 format=5.1 label='% 17 and Under' Over18 length= 5 label='Over 18' pct_Over18 length=3 format=5.1 label='% Over 18' Over18_Male length= 5 label='Over 18 Male' pct_Over18_Male length=3 format=5.1 label='% Over 18 Male' Over18_Female length= 5 label='Over 18 Female' pct_Over18_Female length=3 format=5.1 label='% Over 18 Female' Over21 length= 5 label='Over 21' pct_Over21 length=3 format=5.1 label='% Over 21' Over62 length= 5 label='Over 62' pct_Over62 length=3 format=5.1 label='% Over 62' Over65 length= 5 label='Over 65' pct_Over65 length=3 format=5.1 label='% Over 65' Over65_Male length= 5 label='Over 65 Male' ; Attrib pct_Over65_Male length=3 format=5.1 label='% Over 65 Male' Over65_Female length= 5 label='Over 65 Female' pct_Over65_Female length=3 format=5.1 label='% Over 65 Female' One_race_Total length= 5 label='One Race: Total' pct_One_race_Total length=3 format=5.1 label='% One Race: Total' White1 length= 5 label='White Alone' pct_White1 length=3 format=5.1 label='% White Alone' Black1 length= 5 label='Black or African American Alone' pct_Black1 length=3 format=5.1 label='% Black or African American Alone' Indian length= 5 label='American Indian or Alaska Native Alone' pct_Indian length=3 format=5.1 label='% American Indian or Alaska Native Alone' Asian1 length= 5 label='Asian Alone' pct_Asian1 length=3 format=5.1 label='% Asian Alone' Asian_Indian length= 5 label='Asian Indian' pct_Asian_Indian length=3 format=5.1 label='% Asian Indian' Chinese length= 5 label='Chinese' pct_Chinese length=3 format=5.1 label='% Chinese' Filipino length= 5 label='Filipino' pct_Filipino length=3 format=5.1 label='% Filipino' Japanese length= 5 label='Japanese' ; Attrib pct_Japanese length=3 format=5.1 label='% Japanese' Korean length= 5 label='Korean' pct_Korean length=3 format=5.1 label='% Korean' Vietnamese length= 5 label='Vietnamese' pct_Vietnamese length=3 format=5.1 label='% Vietnamese' Other_Asian length= 5 label='Other Asian' pct_Other_Asian length=3 format=5.1 label='% Other Asian' HawnPI1 length= 5 label='Hawaiian and Other Pac Islndr Alone' pct_HawnPI1 length=3 format=5.1 label='% Hawaiian and Other Pac Islndr Alone' Hawaiian length= 5 label='Native Hawaiian' pct_Hawaiian length=3 format=5.1 label='% Native Hawaiian' Guam_or_Cham length= 5 label='Guamanian or Chamorro' pct_Guam_or_Cham length=3 format=5.1 label='% Guamanian or Chamorro' Samoan length= 5 label='Samoan' pct_Samoan length=3 format=5.1 label='% Samoan' Other_Pac_Islander length= 5 label='Other Pacific Islander Alone' pct_Other_Pac_Islander length=3 format=5.1 label='% Other Pacific Islander Alone' Other1 length= 5 label='Some other race Alone' pct_Other1 length=3 format=5.1 label='% Some other race Alone' MultRace length= 5 label='Multi Racial' ; Attrib pct_MultRace length=3 format=5.1 label='% Multi Racial' White2 length= 5 label='White Alone or in Combination' pct_White2 length=3 format=5.1 label='% White Alone or in Combination' Black2 length= 5 label='Black or African American Alone or in Comb' pct_Black2 length=3 format=5.1 label='% Black or African American Alone or in Comb' Indian2 length= 5 label='American Indian or Alaska Native Alone or in Comb' pct_Indian2 length=3 format=5.1 label='% American Indian or Alaska Native Alone or in Comb' Asian2 length= 5 label='Asian Alone or in Comb' pct_Asian2 length=3 format=5.1 label='% Asian Alone or in Comb' Hawnpi2 length= 5 label='Hawaiian and Other Pac Islndr Alone or in Comb' pct_Hawnpi2 length=3 format=5.1 label='% Hawaiian and Other Pac Islndr Alone or in Comb' Other2 length= 5 label='Other race Alone or in Comb' pct_Other2 length=3 format=5.1 label='% Other race Alone or in Comb' HispPop length= 5 label='Total Hispanic or Latino (any Race)' pct_HispPop length=3 format=5.1 label='% Total Hispanic or Latino (any Race)' Mexican length= 5 label='Mexican' pct_Mexican length=3 format=5.1 label='% Mexican' Puerto_Rican length= 5 label='Puerto Rican' pct_Puerto_Rican length=3 format=5.1 label='% Puerto Rican' Cuban length= 5 label='Cuban' ; Attrib pct_Cuban length=3 format=5.1 label='% Cuban' Other_Hisp length= 5 label='Other Hispanic or Latino' pct_Other_Hisp length=3 format=5.1 label='% Other Hispanic or Latino' Non_Hispanic length= 5 label='Not Hispanic or Latino' pct_Non_Hispanic length=3 format=5.1 label='% Not Hispanic or Latino' White_Non_Hispanic length= 5 label='White Alone Non Hispanic' pct_White_Non_Hispanic length=3 format=5.1 label='% White Alone Non Hispanic' HHPop length= 5 label='Persons In households' pct_HHPop length=3 format=5.1 label='% Persons In households' Householder length= 5 label='Householder' pct_Householder length=3 format=5.1 label='% Householder' Spouse length= 5 label='Spouse' pct_Spouse length=3 format=5.1 label='% Spouse' Child length= 5 label='Child' pct_Child length=3 format=5.1 label='% Child' OwnChild_Under18 length= 5 label='Own child under 18' pct_OwnChild_Under18 length=3 format=5.1 label='% Own child under 18' Other_relatives length= 5 label='Other Relatives' pct_Other_relatives length=3 format=5.1 label='% Other Relatives' Other_Under18 length= 5 label='Other Relatives under 18' ; Attrib pct_Other_Under18 length=3 format=5.1 label='% Other Relatives under 18' Nonrelatives length= 5 label='Nonrelatives' pct_Nonrelatives length=3 format=5.1 label='% Nonrelatives' Unmarried_partner length= 5 label='Unmarried Partner' pct_Unmarried_partner length=3 format=5.1 label='% Unmarried Partner' GQPop length= 5 label='Group Quarters' pct_GQPop length=3 format=5.1 label='% Group Quarters' Institution_Pop length= 5 label='Institutionalized Pop' pct_Institution_Pop length=3 format=5.1 label='% Institutionalized Pop' NonInstitution_Pop length= 5 label='Non Institutionalized GQ Pop' pct_NonInstitution_Pop length=3 format=5.1 label='% Non Institutionalized GQ Pop' TotHHs length= 5 label='Total Households' Families length= 5 label='Family Households' pct_Families length=3 format=5.1 label='% Family Households' Fam_ChildUnder18 length= 5 label='Families with own children < 18' pct_Fam_ChildUnder18 length=3 format=5.1 label='% Families with own children < 18' Married_Couple length= 5 label='Married Couple Family' pct_Married_Couple length=3 format=5.1 label='% Married Couple Family' MarrCouple_ChildUnder18 length= 5 label='Married Couple Own Children < 18' pct_MarrCouple_ChildUnder18 length=3 format=5.1 label='% Married Couple Own Children < 18' ; Attrib FemaleHouseholder length= 5 label='Female Householder No Husband' pct_FemaleHouseholder length=3 format=5.1 label='% Female Householder No Husband' Fem_ChildUnder18 length= 5 label='Female Householder With Own Child < 18' pct_Fem_ChildUnder18 length=3 format=5.1 label='% Female Householder With Own Child < 18' NonFamily_Households length= 5 label='Non Family Households' pct_NonFamily_Households length=3 format=5.1 label='% Non Family Households' LivingAlone length= 5 label='Persons Living Alone' pct_LivingAlone length=3 format=5.1 label='% Persons Living Alone' Householder_Over65 length= 5 label='Householder 65+' pct_Householder_Over65 length=3 format=5.1 label='% Householder 65+' House_IndvUnder18 length= 5 label='Households w. Individuals Under 18' pct_House_IndvUnder18 length=3 format=5.1 label='% Households w. Individuals Under 18' House_IndvOver65 length= 5 label='Households w. Individuals Over 65' pct_House_IndvOver65 length=3 format=5.1 label='% Households w. Individuals Over 65' Avg_HouseSize length= 5 label='Avg Household Size' Avg_FamSize length= 5 label='Avg Family Size' Same_sex_partner_hhs_male length=5 label='Same Sex partner Households - Male' pct_Same_sex_partner_hhs_male length=3 format=5.1 label='Same Sex partner Households - Male' Same_sex_partner_hhs_female length=5 label='Same Sex partner Households - Female' pct_Same_sex_partner_hhs_female length=3 format=5.1 label='Same Sex partner Households - Female' Tot_Units length= 5 label='Total Housing Units' Occupied_Units length= 5 label='Occupied Housing Units' pct_Occupied_Units length=3 format=5.1 label='% Occupied Housing Units' Vacant_Units length= 5 label='Vacant Housing Units' ; Attrib gqpop length= 5 label ='Population in Group quarters' pct_gqpop length=3 format=5.1 label='% Population in Group quarters' Institution_pop length= 5 label='Institutionalized population' pct_Institution_pop length=3 format=5.1 label='% Institutionalized population' correction_institutions length= 5 label='Correctional Institutions' pct_correction_institutions length=3 format=5.1 label='% Correctional Institutions' Nursing_homes length= 5 label='Nursing Homes' pct_Nursing_homes length=3 format=5.1 label='% Nursing Homes' Other_institutions length= 5 label='Other Institutions' pct_Other_institutions length=3 format=5.1 label='% Other Institutions' NonInstitution_pop length= 5 label='Noninstitutionalized population' pct_NonInstitution_pop length=3 format=5.1 label='% Noninstitutionalized population' military_quarters length= 5 label='Military Quarters' pct_military_quarters length=3 format=5.1 label='% Military Quarters' College_dormitories length= 5 label='College dormitories (includes college quarters off campus)' pct_College_dormitories length=3 format=5.1 label='% College dormitories' other_noninstitution_gp length= 5 label='Other noninstitutional group quarters' pct_other_noninstitution_gp length=3 format=5.1 label='% Other noninstitutional group quarters' ; Attrib pct_Vacant_Units length=3 format=5.1 label='% Vacant Housing Units' vacantforrent length= 5 label='Units - Vacant for Rent' pct_vacantforrent length=3 format=5.1 label='% Units - Vacant for Rent' vacantforsale length= 5 label='Units - Vacant for Sale' pct_vacantforsale length=3 format=5.1 label='% Units - Vacant for Sale' Seas_Rec_Use length= 5 label='Units - Seasonal, Rec or Occasional Use' pct_Seas_Rec_Use length=3 format=5.1 label='% Units - Seasonal, Rec or Occasional Use' OwnerVacRate length= 5 label='Owner Unit Vacancy Rate' RentalVacRate length= 5 label='Rental Unit Vacancy Rate' Occupied_Units length= 5 label='Occupied Housing Units' Owner_Occupied length= 5 label='Owner-occupied Units' pct_Owner_Occupied length=3 format=5.1 label='% Owner-occupied Units' Renter_Occupied length= 5 label='Renter-occupied Units' pct_Renter_Occupied length=3 format=5.1 label='% Renter-occupied Units' AvgSize_Owner length= 5 label='Avg Size of Owner-occupied Units' AvgSize_Renter length= 5 label='Avg Size of Renter-occupied Units' ; attrib poppsqmi length=5 format=7.1 label='Persons Per Sq Mile'; *-general population--; esriid=compress(geocode,'-.'); totpop=p1i1; if areasqmi gt 0 then poppsqmi=totpop/areasqmi; male=p12i2; female=p12i26; %macro percent(compvar= , basevar= ); if &basevar gt 0 then pct_&compvar=(&compvar/&basevar)*100; %mend percent; %percent(compvar=male,basevar=totpop); %percent(compvar=female,basevar=totpop); *--persons by age--; age0_4 = p12i3+p12i27; age5_9 = p12i4+p12i28; age10_14=p12i5+p12i29 ; age15_19=p12i6+p12i7+p12i30+p12i31; age15_17=p12i6+p12i30; age18_19=p12i7+p12i31; age20_24=sum(of p12i8-p12i10)+sum(of p12i32-p12i34); age25_34=(p12i11 + p12i12)+(p12i35+p12i36); age35_44=(p12i13+p12i14)+(p12i37+p12i38); age45_54=(p12i15 + p12i16)+(p12i39+p12i40); age55_59=p12i17+p12i41; age60_64=(p12i18 +p12i19) +(p12i42 + p12i43); age65_74=(p12i20+p12i21+p12i22) + (p12i44+p12i45+p12i46); age75_84=(p12i23 + p12i24)+(p12i47+p12i48); over85=p12i25+p12i49; median_age=p13i1; age17_down=sum (of p12i3-p12i6) +sum (of p12i27-p12i30); over18=sum(of p12i7-p12i25)+sum(of p12i31-p12i49); over18_male=sum(of p12i7-p12i25); over18_female=sum(of p12i31-p12i49); over21=sum(of p12i9-p12i25)+sum(of p12i33-p12i49); age18_24=sum(of p12i7-p12i10)+ sum(of p12i31-p12i34); age25_44=sum( of p12i11-p12i14)+sum(of p12i35-p12i38); age45_64=sum( of p12i15-p12i19)+sum(of p12i39-p12i43); over62=sum(of p12i19 - p12i25)+ sum(of p12i43-p12i49); over65=sum(of p12i20 - p12i25)+ sum(of p12i44-p12i49); over65_male=sum(of p12i20 - p12i25); over65_female=sum(of p12i44-p12i49); %percent(compvar=age0_4,basevar=totpop); %percent(compvar=age5_9 ,basevar=totpop); %percent(compvar=age10_14,basevar=totpop); %percent(compvar=age15_19,basevar=totpop); %percent(compvar=age15_17,basevar=totpop); %percent(compvar=age18_19,basevar=totpop); %percent(compvar=age20_24,basevar=totpop); %percent(compvar=age25_34,basevar=totpop); %percent(compvar=age35_44,basevar=totpop); %percent(compvar=age45_54,basevar=totpop); %percent(compvar=age55_59,basevar=totpop); %percent(compvar=age60_64,basevar=totpop); %percent(compvar=age65_74,basevar=totpop); %percent(compvar=age75_84,basevar=totpop); %percent(compvar=over85,basevar=totpop); %percent(compvar=median_age,basevar=totpop); %percent(compvar=age17_down,basevar=totpop); %percent(compvar=over18,basevar=totpop); %percent(compvar=over18_male,basevar=totpop); %percent(compvar=over18_female,basevar=totpop); %percent(compvar=over21,basevar=totpop); %percent(compvar=age18_24,basevar=totpop); %percent(compvar=age25_44,basevar=totpop); %percent(compvar=age45_64,basevar=totpop); %percent(compvar=over62,basevar=totpop); %percent(compvar=over65,basevar=totpop); %percent(compvar=over65_male,basevar=totpop); %percent(compvar=over65_female,basevar=totpop); *--persons by race--*; one_race_total=p3i2; white1=p3i3; black1=p3i4; indian=p3i5; asian1=p3i6; *<--initially this was p3i6 + p3i7 (sic)--; asian_indian=pct5i2; chinese=pct5i5+pct5i15; filipino=pct5i6; japanese=pct5i9; korean=pct5i10; vietnamese=pct5i17; other_asian=p3i6-(pct5i2+pct5i5+pct5i15+pct5i6+pct5i9+pct5i10+pct5i17); hawnpi1=p3i7; hawaiian=pct8i3; guam_or_cham=pct8i8; samoan=pct8i4; other_pac_islander=p3i7-(pct8i3+pct8i8+pct8i4); other1=p3i2-(p3i3+p3i4+p3i5+p3i6+p3i7); %percent(compvar=one_race_total,basevar=totpop); %percent(compvar=white1,basevar=totpop); %percent(compvar=black1,basevar=totpop); %percent(compvar=indian,basevar=totpop); %percent(compvar=asian1,basevar=totpop); %percent(compvar=asian_indian,basevar=totpop); %percent(compvar=chinese,basevar=totpop); %percent(compvar=filipino,basevar=totpop); %percent(compvar=japanese,basevar=totpop); %percent(compvar=korean,basevar=totpop); %percent(compvar=vietnamese,basevar=totpop); %percent(compvar=other_asian,basevar=totpop); %percent(compvar=hawnpi1,basevar=totpop); %percent(compvar=hawaiian,basevar=totpop); %percent(compvar=guam_or_cham,basevar=totpop); %percent(compvar=samoan,basevar=totpop); %percent(compvar=other_pac_islander,basevar=totpop); %percent(compvar=other1,basevar=totpop); multrace=p3i9; %percent(compvar=multrace,basevar=totpop); * Race alone or in combination with one or more other races *; white2=p9i2; black2=p9i3; indian2=p9i4; asian2=p9i5; hawnpi2=p9i6; other2=p9i7; HispPop=p11i1; mexican=pct11i4; puerto_rican=pct11i5; cuban=pct11i6; other_hisp=pct11i3-(pct11i4+pct11i5+pct11i6); non_hispanic=pct11i2; white_non_hispanic=p4i5; %percent(compvar=white2,basevar=totpop); %percent(compvar=black2,basevar=totpop); %percent(compvar=indian2,basevar=totpop); %percent(compvar=asian2,basevar=totpop); %percent(compvar=hawnpi2,basevar=totpop); %percent(compvar=other2,basevar=totpop); %percent(compvar=hisppop,basevar=totpop); %percent(compvar=mexican,basevar=totpop); %percent(compvar=puerto_rican,basevar=totpop); %percent(compvar=cuban,basevar=totpop); %percent(compvar=other_hisp,basevar=totpop); %percent(compvar=non_hispanic,basevar=totpop); %percent(compvar=white_non_hispanic,basevar=totpop); *-- relationship --; hhpop=p27i2; householder=p15i1; spouse=p27i7; child=p27i8; ownchild_under18=p28i6+p28i7; other_relatives=sum (of p27i11- p27i14); other_under18=p28i10; nonrelatives=p27i15+p27i23; unmarried_partner=pct15i5+pct15i11; %percent(compvar=hhpop,basevar=totpop); %percent(compvar=householder,basevar=totpop); %percent(compvar=spouse,basevar=totpop); %percent(compvar=child,basevar=totpop); %percent(compvar=ownchild_under18,basevar=totpop); %percent(compvar=other_relatives,basevar=totpop); %percent(compvar=other_under18,basevar=totpop); %percent(compvar=nonrelatives,basevar=totpop); %percent(compvar=unmarried_partner,basevar=totpop); *--households by type--; tothhs=p15i1; families=p18i6; fam_childunder18=p18i8+p18i12+p18i15; married_couple=p18i7; marrcouple_childunder18=p18i8; femalehouseholder=p18i14; *-female headed family non-mc hhs; fem_childunder18=p18i15; *--female headed hh no husband w kids; nonfamily_households=p18i17+p18i2; livingalone=p18i2; householder_over65=p20i30; house_indvunder18=p19i2; *-- households with individuals under 18 yrs; house_indvover65=p23i2; *-- household with individuals 65 years and over; if p15i1 gt 0 then avg_housesize= p27i2/p15i1; format avg_housesize 4.2; avg_famsize=p33i1; format avg_famsize 4.2; %percent(compvar=tothhs,basevar=tothhs); %percent(compvar=families,basevar=tothhs); %percent(compvar=fam_childunder18,basevar=tothhs); %percent(compvar=married_couple,basevar=tothhs); %percent(compvar=marrcouple_childunder18,basevar=tothhs); %percent(compvar=femalehouseholder,basevar=tothhs); %percent(compvar=fem_childunder18,basevar=tothhs); %percent(compvar=nonfamily_households,basevar=tothhs); %percent(compvar=livingalone,basevar=tothhs); %percent(compvar=householder_over65,basevar=tothhs); %percent(compvar=house_indvunder18,basevar=tothhs); %percent(compvar=house_indvover65,basevar=tothhs); *--Group Quarters ----------------; gqpop=p37i1; Institution_pop=p37i2; correction_institutions=p37i3; Nursing_homes=p37i4; Other_institutions=p37i5; NonInstitution_pop=p37i6; College_dormitories=p37i7; Military_quarters=p37i8; other_noninstitution_gp=p37i9; %percent(compvar=gqpop,basevar=totpop); %percent(compvar=Institution_pop,basevar=totpop); %percent(compvar= correction_institutions,basevar=totpop); %percent(compvar=Nursing_homes,basevar=totpop); %percent(compvar=Other_institutions,basevar=totpop); %percent(compvar=NonInstitution_pop,basevar=totpop); %percent(compvar=College_dormitories,basevar=totpop); %percent(compvar=Military_quarters,basevar=totpop); %percent(compvar=other_noninstitution_gp,basevar=totpop); *--housing occupancy and tenure--; tot_units=h1i1; occupied_units=h3i2; owner_occupied=h4i2; renter_occupied=h4i3; vacant_units=h5i1; vacantforrent=h5i2; vacantforsale=h5i3; seas_rec_use=h5i5; if (h5i3+h4i2) gt 0 then ownervacrate=(h5i3/(h5i3+h4i2))*100; format ownervacrate 5.2; if (h5i2+h4i3) gt 0 then rentalvacrate=(h5i2/(h5i2+h4i3))*100; format rentalvacrate 5.2; * label tot_units = 'total housing units' occupied_units='occupied housing units' vacant_units='vacant housing units' vacantforrent='Vacant for rent' vacantforsale='Vacant for Sale only' seas_rec_use= 'For Seasonal, recrtnl, or occasnl use' ownervacrate='homeowner vacancy rate' rentalvacrate='rental vacancy rate'; avgsize_owner=h12i2; format avgsize_owner 5.2; avgsize_renter=h12i3; format avgsize_renter 5.2; %percent(compvar=tot_units,basevar=tot_units); %percent(compvar=occupied_units,basevar=tot_units); %percent(compvar=owner_occupied,basevar=tot_units); %percent(compvar=renter_occupied,basevar=tot_units); %percent(compvar=vacant_units,basevar=tot_units); %percent(compvar=vacantforrent,basevar=tot_units); %percent(compvar=vacantforsale,basevar=tot_units); %percent(compvar=seas_rec_use,basevar=tot_units); * label owner_occupied='owner occupied housing units' renter_occupied='renter occupied housing units' avgsize_owner='avg household size of oou' avgsize_renter='avg household size of rou'; retain year '2000'; keep sumlev geo_id geocode geocomp state stab areaname county tract bg block cousubfp placefp zcta5 areasqmi landsqmi intptlon intptlat esriid totpop -- avgsize_renter poppsqmi--year; run; proc sort data =_2000&stab; by sumlev geocode; run; %end; %*<==========Step 1 code; %let keep90= %str(keep=sumlev geocode state totpop rename=(totpop=totpop90) ); *<============NOTE: This section of code may need to be edited per the specific geographic area being converted==; data %if &iset %then %str( sf12000x.&stab.i(label="Std extract fr sf1 data for &ustab + 90 Pop - Inventory summaries") ); %if &hset %then %str( sf12000x.&stab.h(label="Std extract fr sf1 data for &ustab + 90 Pop - Hierarchal summaries") ); %if &bset %then %str( sf12000x.&stab.blks(label="Std extract fr sf1 data for &ustab + 90 Pop - Block summaries") ); ; merge _2000&stab(in=in2k) %if &set90=us %then %do; stf901x2.us (where=(state="&state") &keep90 in=in90i); %end; %else %if &iset %then %do; stf901x2.&stab.i ( &keep90 in=in90i) %end; %if &bset %then %do; stf901x2.&stab.blks ( &keep90 in=in90b) %end; %if &hset %then %do; stf901x2.&stab.h ( &keep90 in=in90h) %end; ; by sumlev geocode; if in2k; if in90i %if &hset %then %str( or in90h ); %if &bset %then %str( or in90b ); then do; change=totpop - totpop90; if totpop90 then pctchange=100*change/totpop90; end; if sumlev='101' then %if &bset %then %str( output sf12000x.&stab.blks;); %else %str( delete;); else if sumlev in ('070','080','091') then %if &hset %then %str( output sf12000x.&stab.h; ); %else %str( delete;); else output sf12000x.&stab.i; run; proc contents data=sf1x.&stab.i position; run; %mend doit; /*<=========================Comment out===================================== ===========================End commented out================================ */ %doit(29,mo,step1=1); %doit(20,ks,step1=1); %doit(17,il,step1=1); *-------------During testing phase, we compare the variables and values in this data set with those in the corresponding sf1prof data set.---------------------;