x cd /pub/data/acspums/Tools; %let pgm=application_militaryfamskids; filename pgm "&pgm..sas" ; *---the request from Deirdre DeJesus U of Hawaii at Manoa for state Dept of Human Svcs. Jan 2015. ----; libname user '/SAS_temp/user'; libname acspums '/pub/data/acspums' access=readonly; %let year=2012; %let yr=12; data &pgm; merge acspums.ushrecs&yr.3yra(keep=serialno wgtp state fes hht where=(hht in ("1","2","3") and state="15") in=inhrecs) acspums.usprecs&yr.3yra(keep=serialno state agep relp mil where=(state="15" and '00'<=relp<='04') in=inprecs) end=lastobs; by state serialno; if inhrecs; *<---filters to keep data only for hhs that are family hhs and persons in those hhs--; if first.serialno then do; InMilitary=0; Nkids=0; Youngest=0; retain InMilitary--Youngest; end; if relp in ('00','01') then do; if mil="1" then InMilitary+1; end; else if agep < 18 then do; nkids+1; if nkids=1 then youngest=agep; else if agep < youngest then youngest=agep; end; if last.serialno then do; retain ACSVintage "&year"; if InMilitary; output; end; label nkids='# Kids < 18' youngest='Youngest Child'; drop relp agep relp mil; run; proc format; value nkids 4-high="4 or more"; value $hht 1='Married Couple' 2='Male HH, no wife present' 3='Female HH, no husband present' ; VALUE $FES ' '='N/A (GQ/vacant/not a family) ' '1 '='Married-couple family: Husband and wife in LF ' '2 '='Married-couple family: Husband in labor force, wife not in LF ' '3 '='Married-couple family: Husband not in LF, wife in LF ' '4 '='Married-couple family: Neither husband nor wife in LF ' '5 '='Other family: Male householder, no wife present, in LF ' '6 '='Other family: Male householder, no wife present, not in LF ' '7 '='Other family: Female householder, no husband present, in LF ' '8 '='Other family: Female householder, no husband present, not in LF ' ; run; title "Tabulations of Military (active) Households Circa 2012 Residing in Hawaii"; title2 "Excludes Military Living in Barracks or in Separate Households"; footnote h=.5 "From setup in acs/Tools/&pgm..sas Using usprecs123yra dataset"; title3 "Weighted Estimates From 3% Sample"; ods html file="&pgm..html" style=sasweb; proc tabulate data=&pgm; freq wgtp; class fes hht nkids Youngest InMilitary; format fes $fes. hht $hht. nkids nkids.; label InMilitary ="#Adults in HH In Military"; table all hht , (all nkids Youngest); table fes ; table inmilitary; run; title3 "UnWeighted Data From 3% Sample"; proc tabulate data=&pgm; **************freq wgtp; class fes hht nkids Youngest InMilitary; format fes $fes. hht $hht. nkids nkids.; label InMilitary ="#Adults in HH In Military"; table all hht , (all nkids Youngest); table fes ; table inmilitary; run; ods html close;