/******************************************************************************** AFDC1985.sas 4/15/99 SAS routine that reads ascii files of unit-level and person-level AFDC-QC data for 1985 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 16, 2002 (JWM) *********************************************************************************/ filename in1 'c:\afdc_qc\downloads\afun1985'; filename in2 'c:\afdc_qc\downloads\afpr1985'; x 'gzip -d c:\afdc_qc\downloads\afun1985'; x 'gzip -d c:\afdc_qc\downloads\afpr1985'; 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" 99="unkown" .="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F83REVTY 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" 9="unkown" . ="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FYY 99="unknown" . ="blank" -1="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" 99="unkown" .="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F83STATD 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="Unable to locate case record(FS)" 7="Not processed(Food Stamp only)" 8="Other" 9="unkown" .="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FMMREOPE 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="unkown" . ="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FDDREOPE 99="unknown" . ="blank" ; VALUE FYYREOPE 99="unknown" . ="blank" -1="VALUE NOT IN CODEBOOK" ; VALUE FMMACTIO 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="unkown" .="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FDDACTIO 99="unknown" .="blank" ; VALUE FYYACTIO 99="unknown" .="blank" -1="VALUE NOT IN CODEBOOK" ; VALUE F84TYPAC 1="Initial approval or certification" 2="Reopend following discontinuance action" 3="Redetermination/recertification" 9="unkown" .="blank" 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 F83SHLTR 1="Owns or is buying home" 2="Public housing" 3="HUD rent subsidy" 4="Other rent subsidy" 5="Private housing without subsidy" 6="Rent free" 7="Shares group quarters" 9="unkown" . ="blank" 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" 9="unkown" .="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F83RSTRC 1="Not a restricted payment case" 2="Inadequate managemnt of assistnce paymnt" 3="Refused participation in WIN" 4="Refused to assign support rights to IV-D" 5="Refused to cooperate with IV-D agency" 6="Other" 7="Vendor payment" 8="Two-party payment" 9="Voluntarily requested by recipient" .="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" 9="unkown" .="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE FFSTY83B 1="AFDC" 2="AFDC eligible but not receiving $ payment" 3="Medicaid" 4="Adult Assistance in Territories" 5="All other persons" 9="unkown" .="blank" 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 FSSRR 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 FOTHGOV 9998="$9,998 or more" .Z ="zero" .U ="unknown" ; VALUE FGAST 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 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" 99="unknown" .="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F83INST 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="Other" 9="unknown" .="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F83EMP 1="9 hours or less" 2="10-29 hours per week" 3="Part time Less than 30 hours" 4="Full-time: 30+hours" 5="30-39 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" 99="unknown" .="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F83AFT 21="Adult:Relative caretaker (payee)" 22="Adult:Spouse" 23="Child:Deceased" 24="Child:Incapacitated" 25="Child:Unemployed" 26="Child:Divorced or legally separated" 27="Child:Not legally separated (incl desertion)" 28="Child:Not married to each other" 29="Child:Other" 30="Child:Recip in another (Nonsample) AFDC unit" 31="Nonrecipient:Natural or adoptive parent" 32="Nonrecipient:Stepparent" 33="Nonrecipient:Grandparent" 34="Nonrecipient:Brother/sister" 35="Nonrecipient:Other relative" 36="Nonrecipient:Nonrelative" 99="unknown" .="blank" OTHER="VALUE NOT IN CODEBOOK" ; VALUE F83REL 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" 99="unknown" .="blank" 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 =TYPACT84 statedis=statds83 unborn =unborn83 sheltr =sheltr83 RESTRC =rstrc83 revtyp =revtyp83 ; *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 REVTYP83 YY MM STATDS83 YYREOPEN MMREOPEN DDREOPEN YYACTION MMACTION DDACTION TYPACT84 TOTAU rstrc83 UNBORN83 PRIORA SHELTR83 NUMPER/missing; title '******** 1985 ******** the unit level variables'; format STATE FSTATE. REVTYP83 F83REVTY. YY FYY. MM FMM. STATDS83 F83STATDS. MMREOPEN FMMREOPE. DDREOPEN FDDREOPE. YYREOPEN FYYREOPE. MMACTION FMMACTIO. DDACTION FDDACTIO. YYACTION FYYACTIO. TYPACT84 F84TYPAC. LIQAST FLIQAST. RELPRP FRELPRP. CAR FCAR. OTHAST FOTHAST. PRIORA FPRIORA. SHELTR83 F83SHLTR. GROSSY FGROSSY. DDWORK FDDWORK. DDCHLD FDDCHLD. DD3013 F3013DD. NETINC FNETINC. UNBORN83 F83UNBRN. RSTRC83 F83RSTRC. ; 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 filler 4.0 /* OTHERN */ SSRR 4.0 filler 4.0 /* VA */ SSI 4.0 UCOMP 4.0 filler 4.0 /* WCOMP */ OTHGOV 4.0 filler 4.0 /* FSHSE */ filler 4.0 /* INKIND */ filler 4.0 /* DEEMED */ GAST 4.0 filler 4.0 /* EDBENS */ UNINC 4.0 ADCAMT 4.0 filler 4.0 /* CHDSUP */ /*NEDUC 2.0*/ ; rename aft =aft83 rel =rel83 cit =cit83 etp =etp83 emp =emp83 instit=instit83 FSTYPEB=fsty83b ; 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 SSRR=" SSA/Railroad retirement"; label SSI=" Federal SSI benefit"; label UCOMP=" Unemployment compensation"; label OTHGOV=" Other government benefit"; label GAST=" PA or GA"; label UNINC=" Other Unearned"; label ADCAMT=" AFDC"; label CIT=" Citizenship status"; label ETP=" Employment Training Program"; label INSTIT=" Institutional status"; label EMP=" Employment status"; label AFT=" AFDC affiliation"; label REL=" Relationship/Head of Household"; label UNIT_ID="Unit Identifier"; * convert missing codes to .; array array4 WAGE SELFEM EITC SSRR SSI UCOMP OTHGOV GAST UNINC ADCAMT; do over array4; if (array4 eq 0) then array4=.Z; else if (array4 eq 9999) then array4=.U; end; if wage lt 0 then wage=.U; proc freq data = person; tables PER_ID FSTYPEA FSTY83B AFT83 REL83 AGE SEX RACE CIT83 ETP83 EMP83 INSTIT83/missing; TITLE '******** 1985 ******** Person level variables'; format FSTYPEA FFSTYPEA. FSTY83B FFSTY83B. AGE FAGE. SEX FSEX. RACE FRACE. WAGE FWAGE. SELFEM FSELFEM. EITC FEITC. SSRR FSSRR. SSI FSSI. UCOMP FUCOMP. OTHGOV FOTHGOV. GAST FGAST. UNINC FUNINC. ADCAMT FADCAMT. CIT83 F83CIT. ETP83 F83ETP. INSTIT83 F83INST. EMP83 F83EMP. AFT83 F83AFT. REL83 F83REL. ; proc means data = person; var UNIT_ID WAGE SELFEM EITC SSRR SSI UCOMP OTHGOV GAST UNINC ADCAMT; run; x 'gzip c:\afdc_qc\downloads\afun1985'; x 'gzip c:\afdc_qc\downloads\afpr1985'; /************************************* *** 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.afdc1985; 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; **************************************/