/******************************************************************************** AFDC1986.sas 4/15/99 SAS routine that reads ascii files of unit-level and person-level AFDC-QC data for 1986 and prints frequencies and means. NOTE: Edit the filename statements to point to your local drive where the data files have been downloaded. If you want a flat file for analysis, merge the unit and person datasets by unit_id. Optional merge coding is at end of this routine but is initially commented out. If the merge coding is used, also modify the libname statement to point to your local AFDC_QC data directory. The data are downloaded in zipped format. The 'x gzip' commands execute operating system commands that will unzip and then zip the original data files as this routine executes. Thus, it is not necessary for you to separately perform these steps. However, you must first ascertain that you have the gzip utility. See the downloads page for information about gzip. Edited and commented: July 17, 2002 (JWM) *********************************************************************************/ filename in1 'c:\afdc_qc\downloads\afun1986'; filename in2 'c:\afdc_qc\downloads\afpr1986'; x 'gzip -d c:\afdc_qc\downloads\afun1986'; x 'gzip -d c:\afdc_qc\downloads\afpr1986'; options nocenter compress = yes; *options obs=0; proc format; VALUE FSTATE 1="ALABAMA" 2="ALASKA" 4="ARIZONA" 5="ARKANSAS" 6="CALIFORNIA" 8="COLORADO" 9="CONNECTICUT" 10="DELAWARE" 11="DIST. OF COL." 12="FLORIDA" 13="GEORGIA" 15="HAWAII" 16="IDAHO" 17="ILLINOIS" 18="INDIANA" 19="IOWA" 20="KANSAS" 21="KENTUCKY" 22="LOUISIANA" 23="MAINE" 24="MARYLAND" 25="MASSACHUSETTS" 26="MICHIGAN" 27="MINNESOTA" 28="MISSISSIPPI" 29="MISSOURI" 30="MONTANA" 31="NEBRASKA" 32="NEVADA" 33="NEW HAMPSHIRE" 34="NEW JERSEY" 35="NEW MEXICO" 36="NEW YORK" 37="NORTH CAROLINA" 38="NORTH DAKOTA" 39="OHIO" 40="OKLAHOMA" 41="OREGON" 42="PENNSYLVANIA" 44="RHODE ISLAND" 45="SOUTH CAROLINA" 46="SOUTH DAKOTA" 47="TENNESSEE" 48="TEXAS" 49="UTAH" 50="VERMONT" 51="VIRGINIA" 53="WASHINGTON" 54="WEST VIRGINIA" 55="WISCONSIN" 56="WYOMING" 66="GUAM" 72="PUERTO RICO" 78="VIRGIN ISLANDS" . ="Blank" 99="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F86REVTYP 1="AFDC/FS/Medicaid" 2="AFDC/FS" 3="AFDC/Medicaid" 4="FS/Medicaid" 5="AFDC only" 6="FS only" 7="Medicaid only" 8="Adult only" . ="Blank" 9="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FMM 1="january" 2="february" 3="march" 4="april" 5="may" 6="june" 7="july" 8="august" 9="september" 10="october" 11="november" 12="december" . ="Blank" 99="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F86STATD 1="Review completed" 2="Not subject to review/listed in error" 3="Recipient moved out of state" 4="Recipient unwilling to give information" 5="Unable to locate recipient" 6="Not processed(Food Stamp only)" 7="Other" . ="Blank" 9="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FYYREOPEN 99="unknown" . ="Blank" -1="VALUE NOT IN CODEBOOK" ; VALUE FMMREOPEN 1="january" 2="february" 3="march" 4="april" 5="may" 6="june" 7="july" 8="august" 9="september" 10="october" 11="november" 12="december" 99="unknown" . ="Blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FDDREOPEN 99="unknown" . ="Blank" ; VALUE FYYACTION 99="unknown" . ="Blank" -1="VALUE NOT IN CODEBOOK" ; VALUE FMMACTION 1="january" 2="february" 3="march" 4="april" 5="may" 6="june" 7="july" 8="august" 9="september" 10="october" 11="november" 12="december" 99="unknown" . ="Blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FDDACTION 99="unknown" . ="Blank" ; VALUE F86TYPAC 1="Initial approval or certification" 2="Reopend following discontinuance action" 3="Redetermination/recertification" 4="Monthly report (AFDC only)" . ="Blank" 9="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FLIQAST 99998="$99,998 or more" .Z ="zero" .U ="unknown" ; VALUE FRELPRP 99998="$99,998 or more" .Z ="zero" .U ="unknown" ; VALUE FCAR 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FOTHAST 99998="$99,998 or more" .Z ="zero" .U ="unknown" ; VALUE FPRIORA 1="Yes" 2="No" 9="unknown" . ="Blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F86SHLTR 1="Owns or is buying home" 2="Public housing" 3="HUD rent subsidy" 4="Other rent subsidy" 5="Private housing without subsidy" 6="Shares group quarters" 7="Rent free" . ="Blank" 9="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FGROSSY 9998="$9998 or more" .Z ="zero" .U="missing" ; VALUE FDDWORK 998="$998 or more" .Z ="zero" .U ="missing" ; VALUE FDDCHLD 998="$998 or more" .Z ="zero" .U ="missing" ; VALUE F3013DD 998="$998 or more" .Z ="zero" .U ="missing" ; VALUE FNETINC 9998="$9998 or more" .Z ="zero" .U ="missing" ; VALUE F83UNBRN 1="Payment to pregnant mom w no other kids" 2="Special need pay pregnant mom w ot kids" 3="No unborn child assoc with AFDC case" . ="Blank" 9="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F86RSTRC 1="Vendor payment" 2="Two-party payment" 3="Voluntary request of recipient" 4="Inadequate managemnt of assistnce paymnt" 5="Refused participation in WIN" 6="Refused to assign support rights to IV-D" 7="Refused to cooperate with IV-D agency" 8="Other" 9="unknown" . ="Blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FFSTYPEA 1="Member Food Stamp case under review" 2="Member Food Stamp case not under review" 3="Member does not receive Food Stamps" . ="Blank" 9="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FFSTY86B 1="AFDC" 2="AFDC eligible but not receiving $ payment" 3="Medicaid" 4="Adult Assistance" 5="All other persons" . ="Blank" 9="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FAGE 0="Less than 1 year old" 98="98 or more years old" 99="unknown" . ="Blank" ; VALUE FSEX 1="Male" 2="Female" 9="unknown" . ="Blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FRACE 1="White, Non-Hispanic" 2="Black, Non-Hispanic" 3="Hispanic" 4="Asian/Oriental/Pacific Islander" 5="Native American" 9="unknown" . ="Blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FWAGE 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FSELFEM 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FEITC 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FOTHERN 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FSSRR 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FVA 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FSSI 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FUCOMP 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FWCOMP 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FOTHGOV 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FFSHSE 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FINKIND 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FDEEMED 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FGAST 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FEDBENS 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FUNINC 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FADCAMT 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FCHDSUP 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE F86AFT 21="Adult:Natural or adoptive parent" 22="Adult:Stepparent" 23="Adult:Grandparent" 24="Adult:Brother/sister" 25="Adult:Other relative" 26="Adult:Nonrelative" 31="Child:Deceased" 32="Child:Incapacitated" 33="Child:Unemployed" 34="Divorced or legally separated" 35="Child:Not legally separated (includes desertion)" 36="Child:Not married each oth, paternty estab" 37="Child:Not married each oth, paternty not estab" 41="Other unit:Natural or adoptive parent" 42="Other unit:Stepparent" 43="Other unit:Grandparent" 44="Other unit:Brother/sister" 45="Other unit:Other relative" 46="Other unit:Nonrelative" 51="Nonrecipient:Natural or adoptive parent" 52="Nonrecipient:Stepparent" 53="Nonrecipient:Grandparent" 54="Nonrecipient:Brother/sister" 55="Nonrecipient:Other relative" 56="Nonrecipient:Nonrelative" . ="Blank" 99="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F83CIT 1="Born in this State" 2="Born US not this State/State unk" 3="Naturalized citizen" 4="Immigrant wth permanent residence status" 5="Alien accorded refugee status" 6="Alien granted political asylum" 7="Nonimmigrnt admitted for specific period" 8="Alien granted stay of deportation by INS" 9="Mexican citizen with "border" card" 10="Undocumented alien (visa expired, entered illegall" 11="Not U.S. Citizen but exact status unknown" 12="Indiv permanently residing in US legally" 99="unknown" . ="Blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F83ETP 1="Registered:WIN - Mandatory" 2="Registered:WIN - Voluntary" 3="Registered:WIN and CWEP" 4="Registered :WIN, CWEP and Work Supp" 5="Registered:work under FS program" 7="Exempt:Ill, incapacitated, or advanced age" 8="Exempt:Under required age" 9="Exempt:Needed care for ill or incapacitated" 10="Exempt:Relative/caretaker under age child" 11="Exempt:Meeting student elig requirements" 12="Exempt:Participating drug rehab program" 13="Exempt:Emp 30 hr/wk or Fed minx30/wk" 14="Exempt:Emp 80 hr/mo for not < min wage" 15="Exempt:Receiving/applied unemp comp" 16="Exempt:Other (incl failure comply wrk regist)" 20="Regist & Exempt:Ill, incapacitated, or old" 21="Regist & Exempt:vUnder required age" 22="Regist & Exempt:Needed care for illness" 23="Regist & Exempt:Relative/caretaker under age child" 24="Regist & Exempt:Meeting student elig requirements" 25="Regist & Exempt:Participating drug rehab pgm" 26="Regist & Exempt: 30 hr/wk or Fed minx30/wk" 27="Regist & Exempt:Emp 80 hr/mo for not < min wage" 28="Regist & Exempt: or applying for unemployment" 29="Regist & Exempt:Other" . ="Blank" 99="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F86EMP 1="9 hours or less" 2="10-29 hours per week" 3="Part time Less than 30 hours" 4="30-39 hours per week" 5="Full-time: 40 + hours" 10="Active duty military service" 11="Migrant farm labor" 12="Primarily self-employed at farming" 13="Primarily self-employed, non-farm activity" 20="Incapacitated for employment" 21="Full-time homemaker" 22="Attending school or receiving training" 23="Not actively seeking employment" 24="Awaiting recall from layoff" 25="On strike" 26="Unemployed: less than 1 year" 27="Unemployed: more than 1 year" 28="Other unemployed" . ="Blank" 99="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F86INST 1="Not institutionalized" 2="Intermediate care for mentally retarded" 3="Intermediate care or skilled nurse facility" 4="Other long-term care facility or home" 5="Chronic-care-only institutions" 6="Skilled care for mentally retarded" 7="Other" . ="Blank" 9="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F86NEDUC 0="None" 17="Post Graduate work" 19="unknown" . ="Blank" 99="unknown" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F86REL 1="Head of Household (Or Principal Person)" 2="Spouse" 3="Parent" 4="Daughter/son" 5="Stepdaughter/Stepson" 6="Other related person (eg brother,niece)" 7="Foster Child or other unrelated child" 8="Unrelated Adult" 10="Other" . ="Blank" 99="unknown" OTHER="VALUE NOT IN CODEBOOK" ; *read in unit level variables; data unit; infile in1 lrecl = 91 missover; INPUT UNIT_ID 6.0 STATE 2.0 STRATM 2.0 REVTYP 1.0 YY 2.0 MM 2.0 STATEDIS 1.0 YYREOPEN 2.0 MMREOPEN 2.0 DDREOPEN 2.0 YYACTION 2.0 MMACTION 2.0 DDACTION 2.0 TYPACT 1.0 TOTAU 2.0 LIQAST 5.0 RELPRP 5.0 CAR 4.0 OTHAST 5.0 PSTAND 4.0 SAMPAY 4.0 RESTRC 2.0 UNBORN 1.0 PRIORA 1.0 SHELTR 1.0 GROSSY 4.0 DDWORK 3.0 DDCHLD 3.0 DD3013 3.0 NETINC 4.0 NUMPER 2.0 WGT 9.4 ; rename TYPACT =TYPACT86 statedis=statds86 unborn =unborn83 sheltr =sheltr86 RESTRC =rstrc86 revtyp =REVTYP86; ; *label; label UNIT_ID="Unit Identifier"; label STATE="State"; label STRATM="Stratum"; label REVTYP="Receive Type"; label YY="Sample year"; label MM="Sample month"; label STATEDIS="State disposition"; label YYREOPEN="Most Recent Opening Year"; label MMREOPEN="Most Recent Opening Month"; label DDREOPEN="Most Recent Opening Day"; label YYACTION="Most Recent Action Year"; label MMACTION="Most Recent Action Month"; label DDACTION="Most Recent Action Day"; label TYPACT="Type of Action"; label TOTAU="Persons in Assistance Unit"; label LIQAST="Liquid Assets"; label RELPRP="Real Property"; label CAR="Countable vehicle assets"; label OTHAST="Other non-liquid assets"; label PSTAND="Payment standard"; label SAMPAY="Sample month's payment"; label PRIORA="Prior AFDC"; label SHELTR="Shelter Arrangements"; label GROSSY="Gross Countable income"; label DDWORK="Work expenses disregards"; label DDCHLD="Child care disregards"; label DD3013="First 30+1/3 disregards"; label NETINC="Net countable income"; label NUMPER="Number of case members"; label WGT="Unit weight"; label UNBORN="Unborn Children"; label RESTRC="Restricted Payment"; /*** Convert missing codes and negative ones to missing/unknown indicators ***/ array array5 LIQAST RELPRP OTHAST; array array4 CAR PSTAND SAMPAY GROSSY NETINC; array array3 DDWORK DDCHLD DD3013; do over array5; if (array5 eq 0) then array5=.Z; else if (array5 eq 99999 or array5 eq -1) then array5=.U; end; do over array4; if (array4 eq 0) then array4=.Z; else if (array4 eq 9999 or array4 eq -1) then array4=.U; end; do over array3; if (array3 eq 0) then array3=.Z; else if (array3 eq 999 or array3 eq -1) then array3=.U; end; *print out statistics; Proc freq data = unit; tables STATE STRATM REVTYP86 YY MM STATDS86 YYREOPEN MMREOPEN DDREOPEN YYACTION MMACTION DDACTION TYPACT86 TOTAU rstrc86 UNBORN83 PRIORA SHELTR86 NUMPER/MISSING; title '******** 1986 ********* the unit level variables'; format STATE FSTATE. REVTYP86 F86REVTYP. MM FMM. STATDS86 F86STATDS. YYREOPEN FYYREOPE. MMREOPEN FMMREOPE. DDREOPEN FDDREOPE. YYACTION FYYACTIO. MMACTION FMMACTIO. DDACTION FDDACTIO. TYPACT86 F86TYPAC. LIQAST FLIQAST. RELPRP FRELPRP. CAR FCAR. OTHAST FOTHAST. PRIORA FPRIORA. SHELTR86 F86SHLTR. GROSSY FGROSSY. DDWORK FDDWORK. DDCHLD FDDCHLD. DD3013 F3013DD. NETINC FNETINC. UNBORN83 F83UNBRN. RSTRC86 F86RSTRC. ; proc means data = unit; var UNIT_ID LIQAST RELPRP CAR OTHAST PSTAND SAMPAY GROSSY DDWORK DDCHLD DD3013 NETINC WGT; run; *read in person level variables; data person; infile in2 lrecl = 100 missover; INPUT UNIT_ID 6.0 PER_ID 2.0 FSTYPEA 1.0 FSTYPEB 1.0 AFT 2.0 REL 2.0 AGE 2.0 SEX 1.0 RACE 1.0 CIT 2.0 ETP 2.0 EMP 2.0 INSTIT 1.0 WAGE 4.0 SELFEM 4.0 EITC 4.0 OTHERN 4.0 SSRR 4.0 VA 4.0 SSI 4.0 UCOMP 4.0 WCOMP 4.0 OTHGOV 4.0 FSHSE 4.0 INKIND 4.0 DEEMED 4.0 GAST 4.0 EDBENS 4.0 UNINC 4.0 ADCAMT 4.0 CHDSUP 4.0 NEDUC 2.0 ; rename aft =aft86 rel =REL86 cit =cit83 etp =etp83 emp =emp86 instit=instit86 neduc =neduc86 fstypeb=FSTYB86 ; label PER_ID=" Person Identification"; label FSTYPEA=" Food Stamp affiliation"; label FSTYPEB="AFDC/Medicaid receipt"; label AGE=" Age (1-97 actual years)"; label SEX=" Sex"; label RACE=" Race"; label WAGE=" Wages"; label SELFEM=" Self-employment earnings"; label EITC=" Earned income tax credit"; label OTHERN=" Other earned income"; label SSRR=" SSA/Railroad retirement"; label VA=" VA benefits"; label SSI=" Federal SSI benefit"; label UCOMP=" Unemployment compensation"; label WCOMP=" Workmen's compensation"; label OTHGOV=" Other government benefit"; label FSHSE=" Food stamps/Housing subsidy"; label INKIND=" Contribution/Income in kind"; label DEEMED=" Deemed income"; label GAST=" PA or GA"; label EDBENS=" Education grants/scholarship"; label UNINC=" Other Unearned"; label ADCAMT=" AFDC"; label CHDSUP=" Child support pay. to agency"; label AFT=" AFDC affiliation"; label CIT=" Citizenship status"; label ETP=" Employment Training Program"; label EMP=" Employment status"; label INSTIT=" Institutional status"; label NEDUC=" Education level"; label REL=" Relationship/Head of Household"; label UNIT_ID="Unit Identifier"; * convert missing codes to .; array array4 WAGE SELFEM EITC OTHERN SSRR VA SSI UCOMP WCOMP OTHGOV FSHSE INKIND DEEMED GAST EDBENS UNINC ADCAMT CHDSUP; do over array4; if (array4 eq 0) then array4=.Z; else if (array4 eq 9999) then array4=.U; end; if fshse lt 0 then fshse=.U; proc freq data = person; tables PER_ID FSTYPEA FSTYB86 aft86 REL86 AGE SEX RACE CIT83 ETP83 EMP86 instit86 NEDUC86/MISSING; TITLE '******** 1986 ********* Person level variables'; format FSTYPEA FFSTYPEA. FSTYB86 FFSTY86B. AGE FAGE. SEX FSEX. RACE FRACE. WAGE FWAGE. SELFEM FSELFEM. EITC FEITC. OTHERN FOTHERN. SSRR FSSRR. VA FVA. SSI FSSI. UCOMP FUCOMP. WCOMP FWCOMP. OTHGOV FOTHGOV. FSHSE FFSHSE. INKIND FINKIND. DEEMED FDEEMED. GAST FGAST. EDBENS FEDBENS. UNINC FUNINC. ADCAMT FADCAMT. CHDSUP FCHDSUP. aft86 F86AFT. CIT83 F83CIT. ETP83 F83ETP. EMP86 F86EMP. INSTIT86 F86INST. NEDUC86 F86NEDUC. REL86 F86REL. ; run; proc means data = person; var UNIT_ID WAGE SELFEM EITC OTHERN SSRR VA SSI UCOMP WCOMP OTHGOV FSHSE INKIND DEEMED GAST EDBENS UNINC ADCAMT CHDSUP; run; x 'gzip c:\afdc_qc\downloads\afun1986'; x 'gzip c:\afdc_qc\downloads\afpr1986'; /************************************* *** Merge the temporary datasets into a single permanent one; proc sort data=unit; by unit_id; proc sort data=person; by unit_id; libname locdir 'c:\afdc_qc\data'; data locdir.afdc1986; merge unit(in=a) person(in=b) end=eof; by unit_id; retain k1-k2 0; if a and not b then k1+1; else if b and not a then k2+1; if eof then do; put 'In unit dataset but not in person set: ' k1; put 'In person dataset but not in unit set: ' k2; end; run; **************************************/