/*----This is the invoke_dovars module that effectively DEFINES the stf803x2 filetype------ Created by converting the /pub/sascode/stf803x.sas into invocations of dovar macro to create consistenty with the mechanism employed for stf903x2 Progress 2/17/2006 5:21PM Added changes to the table names and universes as indicated in the STF3 Table Outline 2/16/2006 4:55PM Modified the table names, universes, and variable names similar to sft903x2 as closely as possible. The %median macro invocation for two tables has been commented out: when run, it generates a note indicating that there are no lbound and hbound to calculate the median value. Added to invoke_dovars the array declarations similar to stf803x.sas and that generated another error related to a variable in the macro. The %median macros are currently commented out together with the %dovar that defines the median value Checked with Evelyn about table names and universes and variables. Sent her an email reminding her of that documentation. 2/16/2006 9:36AM Added the final two tables from stf803x2 and preparing to check its correctness. 2/15/2006 5:30pm Added several more table conversation fromstf803x2 and debugged this file using the moil... .sas application. 2/14/2006 2:54PM Capitalized first letter of variables defined in dovar Added %str() around value expressions in %dovar Moved into the /pub/data/sft803x/Tools folder as invoke_dovar.sas Remaining: revise with John the use of %median macro whether there is another current mechanism revise with John if I need to capitalize age variables and house holds variables revise if TotPop is preserved from initial calculation througout the application build table 5 and up */ %put ****stf803x2 invoke_dovars code now executing. ; %let display=1; %let table=%str(Total Population); %let universe=All Persons; %let RefTables = T1 T15 T18 T19; %let lvl=0; %let Pctof=; %dovar(TotPop, %str(Total Persons (Sample Est)), t1i1); %let Pctof=TotPop; %dovar(Female, %str(Female pop), %str(sum(of t15i27-t15i52))); %dovar(Males, %str(Males pop), %str(t1i1 - sum(of t15i27-t15i52))); %dovar(RuralPop, %str(Persons in rural areas), t1i3); %dovar(OnFarms, %str(Persons on farms), t7i1); %dovar(InFamily, %str(Persons in families), %str(sum(of t19i1-t19i4))); %dovar(Alone, %str(Persons living alone), t18i1); %dovar(GroupQtr, %str(Persons in group quarters), %str(t19i8+ t19i9)); %dovar(Popinhhs, %str(Population in House), %str(totpop - groupqtr)); %let display=1; %let table=%str(Race/Hispanic); %let universe=Total Population; %let lvl=0; %let RefTables = T12 T14; %let Pctof=TotPop; %dovar(White1, %str(White), t12i1); %dovar(Black1, %str(Black), t12i2); %dovar(Asianpi, %str(Asian & pac islandr pop), %str(sum(of t12i6-t12i15))); %dovar(Amindian, %str(Am indian, esk, aleuts), t12i3); %dovar(HispPop, %str(Hispanic), t14i1); %let display=1; %let table=%str(Age); %let universe =Total Population; %let lvl = 0; %let RefTables = T15; %let Pctof=TotPop; %dovar(Age0_4, %str(Under 5), %str(sum(of t15i1-t15i3))); %dovar(Age5_9, %str(Age 5 to 9), %str(sum(of t15i4-t15i6))); %dovar(Age10_13, %str(10 to 13), t15i7); %dovar(Age14_17, %str(14 to 17), %str(sum(of t15i8-t15i11))); %dovar(Age18_24, %str(18 to 24), %str(sum(of t15i12-t15i16))); %dovar(Age25_34, %str(25 to 34), %str(t15i17 + t15i18)); %dovar(Age35_44, %str(35 to 44), t15i19); %dovar(Age45_54, %str(45 to 54), t15i20); %dovar(Age55_59, %str(55 to 59), t15i21); %dovar(Age60_64, %str(60 to 64), %str(t15i22 + t15i23)); %dovar(Age65_74, %str(65 to 74), t15i24); %dovar(Age75_84, %str(75 to 84), t15i25); %dovar(Age85_up, %str(Over 85), t15i26); %dovar(Age0_19, %str(Under 19), %str(sum(of t15i1-t15i13))); %dovar(Age20_39, %str(20 to 39), %str(sum(of t15i14-t15i18) + .5*t15i19)); %dovar(Age40_64, %str(40 to 64), %str(sum(of t15i20-t15i23) + .5*t15i19)); %dovar(Age65_up, %str(Over 65), %str(sum(of t15i24-t15i26))); *--following 3 subtotals are not in xtabs reports--*; %dovar(Age0_17, %str(Under 17), %str(sum(of Age0_4 -- Age14_17))); %dovar(Age18_44, %str(18 to 44), %str(sum(of Age18_24 -- Age35_44))); %dovar(Age45_64, %str(45 to 64), %str(sum(of Age45_54 -- Age60_64))); %let Pctof=; *--t15 is really a 2*26 table but we only use the first row, total-; array t15 t15i1-t15i26; %*median(intsize=ageint ,intvals=t15 ,mdn=medage); %*dovar(medage, %str(Median age), %str(medage)); %let display=1; %let table=%str(Households by size); %let universe=Households by size; %let lvl=0; %let RefTables = T10 T18; %let Pctof=; %dovar(TotHhs, %str(Total households), t10i1); %dovar(avghhsz, %str(Persons per household), %str((TotPop-GroupQtr)/tothhs)); %let Pctof=TotHhs; %dovar(hhs1, %str(1-person households), t18i1); %dovar(hhs2, %str(1-person households), t18i2); %dovar(hhs2, %str(2-person households), t18i2); %dovar(hhs3_4, %str(3-4 person households), %str(t18i3+t18i4)); %dovar(hhs5_up, %str(5+ person households), %str(sum(of t18i5 -- t18i6))); %let display=1; %let table=%str(Households by Type); %let universe=Households by Type; %let lvl=0; %let RefTables = T9 T20; %let Pctof=TotHhs; %dovar(Families, %str(Families), t9i1); %dovar(Mcfams, %str(Married couples), %str(t20i1+t20i2)); %dovar(Mcwchild, %str(:with related children), t20i1); %dovar(Femhead, %str(Female headed family, no husb.), %str(t20i5+t20i6)); %dovar(Femheadc, %str(:with related chldren), t20i5); %dovar(Nonfhhs, %str(non-family hshlds), t20i7); %let display=1; %let table=%str(Household Income); %let universe=Households; %let lvl=0; %let Reftables = T68 T69 T10 T70; %let Pctof=TotHhs; %dovar(HHInc0_5, %str(Households with income < $5000 1979), %str(t68i1+t68i2)); %dovar(HHInc5_10, %str(Households w income $5k - $9,999), %str(t68i3+t68i4)); %dovar(HHInc10_15, %str(Households w income $10k - $14,999), %str(t68i5+t68i6)); %dovar(HHInc15_20, %str(Households w income $15k - $19,999), %str(t68i7+t68i8)); %dovar(HHInc20_25, %str(Households w income $20k - $24,999), %str(t68i9+t68i10)); %dovar(HHInc25_30, %str(Households w income $25k - $29,999), %str(t68i11+t68i12)); %dovar(HHInc30_40, %str(Households w income $30k - $39,999), %str(t68i13+t68i14)); %dovar(HHInc40_50, %str(Households w income $40k - $49,999), %str(t68i15)); %dovar(HHInc50_75, %str(Households w income $50k - $74,999), %str(t68i16)); %dovar(HHInc75up, %str(Households w income $75,000 & up), %str(t68i17)); %let Pctof=; %dovar(medhhinc, %str(Median hhld income 1979 (1989 $)), %str(t69i1*1.708)); %dovar(avghhinc, %str(Avg househld income 1979 (1989 $)), %str((t70i1*1.708)/tothhs)); %let display=1; %let table=%str(Families by # workers with avg family income); %let universe=families by # workers with avg family income; %let lvl=0; %let RefTables= T79 T80; %let Pctof=; %dovar(famwork0, %str(Families with no workers), %str(t79i1)); %dovar(famwork1, %str(Families with 1 worker), %str(t79i2)); %dovar(avgfami0, %str(Avg fam income: fams w 0 wrkrs-1989 dollars), %str(t80i1*1.708/famwork0)); %dovar(avgfami1, %str(Avg fam income: fams w 1 wrkr-1989 dollars), %str(t80i2*1.708/famwork1)); %let display=1; %let table=%str(Other income measures); %let universe=Families or Persons; %let lvl=0; %let RefTables= T74 T77 T85 T91; %let Pctof=; %dovar(MedianFamInc, %str(Median Family Income 1979 in 1989 dollars), %str(t74i1*1.708)); %dovar(AvgFamInc, %str(Average Family Income 1979 in 1989 dollars), %str(t77i1*1.708/families)); %dovar(PCI, %str(Per capita income 1979 in 1989 dollars), %str(t85i1*1.708)); %dovar(pcihhs, %str(Per Capita Income 1979, persons in hhs in 1989 dollars), %str(t85i2*1.708)); %dovar(popinhhs, %str(), %str(totpop-groupqtr)); %dovar(pooruniv, %str(Persons for whom pov status det), %str(t91i1+ t91i2)); %let Pctof=pooruniv; %dovar(poor, %str(Persons below poverty level), t91i2); %let display=1; %let table=%str(Educational Attainment); %let universe=Persons 25 and Over; %let lvl=0; %let Reftables=T48; %let Pctof=TotPop; %dovar(Over25, %str(Pop > 25 (education univ.)), %str(sum(of t48i1-t48i5))); %let Pctof=Over25; %dovar(LessThan9th, %str(Pop >25 less than 9th grade ed), %str(t48i1)); %dovar(SomeHighSchool, %str(Pop > 25 1-3 yrs high school), %str(t48i2)); %dovar(HighSchool, %str(Pop > 25 4 yrs high school), %str(t48i3)); %dovar(SomeCollege, %str(Pop > 25 1-3 yrs college), %str(t48i4)); %dovar(GradProf, %str(Pop > 25 4 or more yrs college), %str(t48i5)); %let display=1; %let table=%str(Employment status clf); %let universe=Employment status clf; %let lvl=0; %let RefTables=T55; %let Pctof=; %dovar(clf, %str(Civilian Labor Force 16 and up), %str(sum(of t55i2 t55i3 t55i6 t55i7))); %dovar(empovr16, %str(Employed persons 16 and up), %str(t55i2 + t55i6)); %dovar(emplyfem, %str(Employed females), %str(t55i6)); %dovar(clffem, %str(Women in the clf 1979), %str(t55i6+t55i7)); %dovar(nonclff, %str(Women over 16 not in clf 1979), %str(t55i8)); %let Pctof=clffem; %dovar(unempfem, %str(Unemployed female in clf), %str(t55i7)); %let Pctof=clf; %dovar(unemplyd, %str(Unemployed persons 16 and up), %str(t55i3 + t55i7)); %let display=1; %let table=%str(Occupation); %let universe=Employed Civilian Labor Force; %let lvl=0; %let RefTables=T66; %let Pctof=empovr16; %dovar(ManProfOccs, %str(Management professional and related occupations), %str(sum(of t66i1 t66i2))); %dovar(techsadm, %str(Technical, sales, admin support), %str(sum(of t66i3-t66i5))); %dovar(ServiceOccs, %str(Service Occupations), %str(sum(of t66i6-t66i8))); %dovar(FarmFishOccs, %str(Farming, Fishing and Forestry), t66i9); %dovar(otherocc, %str(Other occupations), %str(sum(of t66i10-t66i13))); %let display=1; %let table=%str(Housing Units); %let universe=Housing Units; %let lvl=0; %let RefTables=T96 T97 T11 T102 T103; %let Pctof=; %dovar(TotHUs, %str(Total Housing Units (inc vac seasonal)), %str(sum(of t96i1-t96i4 t97i1))); %let Pctof=TotHUs; %dovar(yrunits, %str(Year round units), t11i1); %dovar(occunity, %str(Occupied y-r hsng units 80), t11i2); %dovar(vacant, %str(Occupied y-r hsng units 80), t11i3); %dovar(Occupied, %str(Occupied housing units), t97i1); %dovar(OwnerOcc, %str(Owner Occupied Housing units), %str(t97i1-t97i2)); %dovar(RenterOcc,%str(Renter Occupied housing units), t97i2); %dovar(units1, %str(Single family units), %str(t102i1+t102i2 +t103i1+t103i2)); %dovar(units5up, %str(Units in 5+ unit buildings), %str(t102i5+t103i5)); %dovar(mobilhms, %str(Mobile homes), t102i6); %let display=1; %let table=%str(Year structure built); %let universe=Households; %let lvl=0; %let RefTables=T109; array t109 t109i1-t109i7; %*median(intsize=agehint, intvals=t109, mdn=medageh); %*dovar(medyarblt, %str(Median year built), %str(1980-medageh)); %let Pctof=yrunits; %dovar(builta75, %str(Units built 1975 - 3/80), %str(t109i1 + t109i2)); %dovar(built70_, %str(Units built 1970 - 3/80), %str(t109i3 + builta75)); %dovar(built60_, %str(Units built 1960-1969), %str(t109i4)); %dovar(built50_, %str(Units built 1950-1959), %str(t109i5)); %dovar(built40_, %str(Units built 1940-1949), %str(t109i6)); %dovar(builtp40, %str(Units built before 1940), %str(t109i7)); %let display=1; %let table=%str(Housing values and rents); %let universe=Households; %let lvl=0; %let RefTables=T133 T140 T124 T127 T128; %let Pctof=; %dovar(spownunt, %str(Specified owner-occupied units), %str(sum(of t133i1-t133i20))); %dovar(avghval, %str(Avg value, owner units (1990 dollars)), %str((t140i1*1000/spownunt)*1.586)); %dovar(untscrnt, %str(Specfd renter units w cash rent), %str(sum(of t124i1-t124i13))); %dovar(medrent, %str(Median gross rent (1990 dollars)), %str(t127i1*1.586)); %dovar(avgrent, %str(Average gross rent (1990 dollars)), %str(t128i1/untscrnt*1.586));