x cd /pub/data/irstaxes/Tools; %let pgm=cnvt_irstaxes_2014; filename pgm "&pgm..sas"; *----Convert and enhance both the ZIP and state/county level CSV files downloaded from the IRS site - tax year 2014 data. https://www.irs.gov/uac/soi-tax-stats-individual-income-tax-statistics-2014-zip-code-data-soi (NOTE: Are these are complete files, NOT preliminary?) We convert to SAS data sets using variable names and labels provided in the Word Docs for these data. Documentation Guide . NOTE: These data summarize individual tax returns by state and county & sometimes Adjusted Gross Income Group for a specified tax year. The returns reflect residence at the time of filing, typically in the spring of the following calendar year. So 2014 data are based mostly on returns submitted between Feb and April of 2015. *<=== We combine all that processing - converting & enhancing - into this single program. The 3 major steps are - stcnty1, (processing of original state/county data), - zip1 (processing the original zip data) - plus_sets to create the _plus enhanced sets (both both types of geography and both agi/noagi sets. J. Blodgett, OSEDA, under contract with the Missouri Census Data Center. Sep 2016. ----*; options ls=140; %let year=2014; *---Income tax year---; %let yr=%substr(&year,3,2); %let yrm1=%eval(&yr - 1); title "&pgm.: Converting IRS Tax Return Data for Tax Year &year"; libname irstaxes '/pub/data/irstaxes'; *--This is where we create the data set(s)---; proc format; *--create a format code for use in assigning the AGI variable--; value $agi 0='0 Total' 1='1 Under $1' 2='2 $1 < $10k' 3='3 $10k < $25k' 4='4 $25k < $50k' 5='5 $50k < $75k' 6='6 $75k < $100k' 7='7 $100k < $200k' 8='8 $200k or more'; value $agizip 0='0 Total' 1='1 Under $25k' 2='2 $25k < $50k' 3='3 $50k < $75k' 4='4 $75k < $100k' 5='5 $100k < $200k' 6='6 $200k or more'; run; ********************Step 1: Read and convert raw county data**********************************; options compress=no; %macro docntys(allno); filename csvinall "/pub/data/irstaxes/&yr.incyallagi.csv"; filename csvinno "/pub/data/irstaxes/&yr.incyallnoagi.csv";*<--dumb name but SOI uses it so we shall too; %local setname; %let setname=uscntys&allno.agi&yr; *<==================================================================; data irstaxes.&setname (label="Income Tax data by State and county for tax year &year &allno AGI Groups" ); length State Stab $2 _cnty $3 County $5 AreaName $18 agi_stub $1 agi $15 SumLev $3; retain TaxYear "&year"; *--13 new variables for 2014 (vs 2013) They are in lower case. --*; Length N1 MARS1 MARS2 MARS4 PREP N2 NUMDEP total_vita vita tce A00100 N02650 A02650 N00200 A00200 N00300 A00300 N00600 A00600 N00650 A00650 N00700 A00700 N00900 A00900 N01000 A01000 N01400 A01400 N01700 A01700 SCHF N02300 A02300 N02500 A02500 N26270 A26270 N02900 A02900 N03220 A03220 N03300 A03300 N03270 A03270 N03150 A03150 N03210 A03210 N03230 A03230 N03240 A03240 N04470 A04470 A00101 N18425 A18425 N18450 A18450 N18500 A18500 N18300 A18300 N19300 A19300 N19700 A19700 N04800 A04800 N05800 A05800 N09600 A09600 a05780 n05780 N07100 A07100 N07300 A07300 N07180 A07180 N07230 A07230 N07240 A07240 N07220 A07220 N07260 A07260 N09400 A09400 n85770 a85770 n85775 a85775 n09750 a09750 N10600 A10600 N59660 A59660 N59720 A59720 N11070 A11070 N10960 A10960 n11560 a11560 N06500 A06500 N10300 A10300 N85330 A85330 N85300 A85300 N11901 A11901 N11902 A11902 5; Format A0: A1: A5: dollar12. n1 mars2 prep n2 numdep schf N0: N1: N5: comma9.; infile csvin&allno dsd missover firstobs=2 lrecl=2056; input state stab _cnty AreaName agi_stub n1--a11902; if _cnty ne '000' then do; County=state||_cnty; SumLev='050'; **AreaName=put(ZIPcode,$zipname.); end; else do; County='00000'; SumLev='040'; *--Standard code indicating a state level summary--; Areaname=put(state,$state.); end; agi=put(agi_stub,$agi.); drop _cnty; Label County="5-digit County Code " agi_stub="Size of Adj Gross Income" agi="Adj Gross Income Catgry" SumLev="Geo Summary Lvl Code" N1="# returns" MARS1="# single returns" MARS2="# joint returns" MARS4="# head of household returns" PREP="# returns with paid preparer's signature" N2="# exemptions" NUMDEP="# dependents" vita=" volunteer income tax assistance prepared rtrns" total_vita="# of volunteer prepared returns" tce="# tax counseling for the edlerly prepared rtrns" A00100="Adjust gross income (AGI) [3]" N02650="# returns with total income" A02650="Total income amount" N00200="# returns with salaries and wages" A00200="Salaries and wages amount" N00300="# returns with taxable interest" A00300="Taxable interest amount" N00600="# returns with ordinary dividends" A00600="Ordinary dividends amount" N00650="# returns with qualified dividends" A00650="Qualified dividends amount [4]" N00700="# returns with state and local income tax refunds" A00700="State and local income tax refunds amount" N00900="# returns with business or professional net income (less loss)" A00900="Business or professional net income (less loss) amount" N01000="# returns with net capital gain (less loss)" A01000="Net capital gain (less loss) amount" N01400="# returns with taxable individual retirement arrangements distributions" A01400="Taxable individual retirement arrangements distributions amount" N01700="# returns with taxable pensions and annuities" A01700="Taxable pensions and annuities amount" SCHF="# farm returns" N02300="# returns with unemployment compensation" A02300="Unemployment compensation amount [5]" N02500="# returns with taxable Social Security benefits" A02500="Taxable Social Security benefits amount" N26270="# returns with partnership/S-corp net income (less loss)" A26270="Partnership/S-corp net income (less loss) amount" N02900="# returns with total statutory adjustments" A02900="Total statutory adjustments amount" N03220="# returns with educator expenses" A03220="Educator expenses amount" N03300="# returns with self-employment retirement plans" A03300="Self-employment retirement plans amount" N03270="# returns with self-employment health insurance deduction" A03270="Self-employment health insurance deduction amount" N03150="# returns with IRA payments" A03150="IRA payments amount" N03210="# returns with student loan interest deduction" A03210="Student loan interest deduction amount" N03230="# returns with tuition and fees deduction" A03230="Tuition and fees deduction amount" N03240="Returns with domestic production activities deduction" A03240="Domestic production activities deduction amount" N04470="# returns with itemized deductions" A04470="Total itemized deductions amount" A00101="Amount of AGI for itemized returns" N18425="# returns with State and local income taxes" A18425="State and local income taxes amount" N18450="# returns with State and local general sales tax" A18450="State and local general sales tax amount" N18500="# returns with real estate taxes" A18500="Real estate taxes amount" N18300="# returns with taxes paid" A18300="Taxes paid amount" N19300="# returns with mortgage interest paid" A19300="Mortgage interest paid amount" N19700="# returns with contributions" A19700="Contributions amount" N04800="# returns with taxable income" A04800="Taxable income amount" N05800="# returns with income tax before credits" A05800="Income tax before credits amount" N09600="# returns with alternative minimum tax" A09600="Alternative minimum tax amount" N07100="# returns with total tax credits" A07100="Total tax credits amount" N07300="# returns with foreign tax credit" A07300="Foreign tax credit amount" N07180="# returns with child and dependent care credit" A07180="Child and dependent care credit amount" N07230="# returns with nonrefundable education credit" A07230="Nonrefundable education credit amount" N07240="# returns with retirement savings contribution credit" A07240="Retirement savings contribution credit amount" N07220="# returns with child tax credit" A07220="Child tax credit amount" N07260="# returns with residential energy tax credit" A07260="Residential energy tax credit amount" N09400="# returns with self-employment tax" A09400="Self-employment tax amount" N10600="# returns with total tax payments" A10600="Total tax payments amount" N59660="# returns with earned income credit" A59660="Earned income credit amount [6]" N59720="# returns with excess earned income credit" A59720="Excess earned income credit (refundable) amount [7]" N11070="# returns with additional child tax credit" A11070="Additional child tax credit amount" N10960="# returns with refundable education credit" A10960="Refundable education credit amount" N06500="# returns with income tax" A06500="Income tax amount [8]" N10300="# returns with tax liability" A10300="Total tax liability amount [9]" N85330="# returns with additional Medicare tax" A85330="Additional Medicare tax amount" N85300="# returns with net investment income tax" A85300="Net investment income tax amount" N11901="# returns with tax due at time of filing" A11901="Tax due at time of filing amount [10]" N11902="# returns with overpayments refunded" A11902="Overpayments refunded amount [11]" n11560="# returns with net premium tax credit" a11560="Net premium tax creit amount" a85770="Total premium tax amount" n85770="# returns with total premium tax credit" n85775="# returns with advanced premium tax credit" a85775="Advance Premium tax credit amount" n09750="# returns with health care individual responsibility payment" a09750="Health care individual responsibility payment amount" n05780="# returns with excess advance premium tax credit repayment" a05780="Excess advance premium tax credit repayment amount" ; run; /* ==============================Footnotes copied from the tech doc for 2014 release====================================== G. Endnotes: [1] For complete individual income tax tabulations at the State level, see the historic table posted to Tax Stats at http://www.irs.gov/uac/SOI-Tax-Stats---Historic-Table-2. [2] The County Federal Information Processing System (FIPS) codes used for these statistics were derived from the U.S. Census Bureau. A complete list of codes can be obtained from https://www.census.gov/geo/reference/codes/cou.html. [3] The "Number of volunteer prepared returns" shows counts of returns prepared by IRS-certified volunteers to taxpayers with limited income, persons with disabilities, limited English speaking taxpayers, current and former members of the military, and taxpayers who are 60 years of age and older. [4] Less deficit. [5] ?Qualified dividends? are ordinary dividends received in tax years beginning after 2002 that meet certain conditions and receive preferential tax rates. The maximum qualified dividends tax rate is 15%. [6] Includes the Alaskan permanent fund, reported by residents of Alaska on Forms 1040A and 1040EZ's. This fund only applies to statistics in the totals, and the state of Alaska. [7] Earned income credit includes both the refundable and non-refundable portions. The non-refundable portion could reduce income tax and certain related taxes to zero. The earned income credit amounts in excess of total tax liability, or amounts when there was no tax liability at all, were refundable. See footnote 8 below for explanation of the refundable portion of the earned income credit. [8] The refundable portion of the earned income credit equals total income tax minus the earned income credit. If the result is negative, this amount is considered the refundable portion. No other refundable credits were taken into account for this calculation. [9] Income tax reflects the amount reported on Form 1040 line 56. It also includes data from Form 1040A and 1040EZ filers. [10] ?Total tax liability? differs from ?Income tax?, in that ?Total tax liability? includes the taxes from recapture of certain prior-year credits, tax applicable to individual retirement arrangements (IRA's), social security taxes on self-employment income and on certain tip income, advanced earned income payments, household employment taxes, and certain other taxes listed in the Form 1040 instructions. [11] Reflects payments to or withholdings made to "Total tax liability". This is the amount the tax filer owes when the income tax return is filed. [12] The amount of overpayments the tax filer requested to have refunded. ===================================End Footnotes========================================================================= */; options ps=90 ls=160; title2 "Data Per irstaxes.&setname Data Set"; proc print data=irstaxes.&setname(obs=50); title3 "First 50"; by taxyear state stab; id county areaname agi; run; proc means data =irstaxes.&setname n mean sum max; title3 "proc means"; class sumlev agi; run; proc datasets library=irstaxes nolist; modify &setname ; index create state; quit; proc sql; create view irstaxes.mocntys&allno.agi&yr as select * from irstaxes.&setname where state='29'; quit; %mend docntys; ***************************Step 2 : Read the ZIPcode level CSV files downloaded from the IRS site.*****************; %macro dozips(allno); filename csvinall "/pub/data/irstaxes/&yr.zpallagi.csv"; filename csvinno "/pub/data/irstaxes/&yr.zpallnoagi.csv"; *--Confusing but it came down as "allnoagi" options compress=binary; %local setname; %let setname=uszips&allno.agi&yr; data irstaxes.&setname (label="Income Tax data by ZIP Code for tax year &year &allno AGI Groups " ); length State Stab $2 ZIPcode $5 AreaName $40 agi_stub $1 agi $15 SumLev $3; retain TaxYear "&year"; *--13 new variables for 2014 (vs 2013 --*; Length N1 MARS1 MARS2 MARS4 PREP N2 NUMDEP total_vita vita tce A00100 N02650 A02650 N00200 A00200 N00300 A00300 N00600 A00600 N00650 A00650 N00700 A00700 N00900 A00900 N01000 A01000 N01400 A01400 N01700 A01700 SCHF N02300 A02300 N02500 A02500 N26270 A26270 N02900 A02900 N03220 A03220 N03300 A03300 N03270 A03270 N03150 A03150 N03210 A03210 N03230 A03230 N03240 A03240 N04470 A04470 A00101 N18425 A18425 N18450 A18450 N18500 A18500 N18300 A18300 N19300 A19300 N19700 A19700 N04800 A04800 N05800 A05800 N09600 A09600 a05780 n05780 N07100 A07100 N07300 A07300 N07180 A07180 N07230 A07230 N07240 A07240 N07220 A07220 N07260 A07260 N09400 A09400 n85770 a85770 n85775 a85775 n09750 a09750 N10600 A10600 N59660 A59660 N59720 A59720 N11070 A11070 N10960 A10960 n11560 a11560 N06500 A06500 N10300 A10300 N85330 A85330 N85300 A85300 N11901 A11901 N11902 A11902 5; Format A0: A1: A5: dollar12. n1 mars2 prep n2 numdep schf N0: N1: N5: comma9.; infile csvin&allno dsd missover firstobs=2 lrecl=2056; input state stab ZIPCode agi_stub n1--a11902; if zipcode ne '00000' then do; SumLev='871'; AreaName=put(ZIPcode,$zipname.); end; else do; SumLev='040'; *--Standard code indicating a state level summary--; Areaname=put(state,$state.); end; agi=put(agi_stub,$agizip.); Label ZIPcode="5-digit ZIP Code " agi_stub="Size of Adj Gross Income" agi="Adj Gross Income Catgry" SumLev="Geo Summary Lvl Code" N1="# returns" MARS1="# single returns" MARS2="# joint returns" MARS4="# head of household returns" PREP="# returns with paid preparer's signature" N2="# exemptions" NUMDEP="# dependents" vita=" volunteer income tax assistance prepared rtrns" total_vita="# of volunteer prepared returns" tce="# tax counseling for the edlerly prepared rtrns" A00100="Adjust gross income (AGI) [3]" N02650="# returns with total income" A02650="Total income amount" N00200="# returns with salaries and wages" A00200="Salaries and wages amount" N00300="# returns with taxable interest" A00300="Taxable interest amount" N00600="# returns with ordinary dividends" A00600="Ordinary dividends amount" N00650="# returns with qualified dividends" A00650="Qualified dividends amount [4]" N00700="# returns with state and local income tax refunds" A00700="State and local income tax refunds amount" N00900="# returns with business or professional net income (less loss)" A00900="Business or professional net income (less loss) amount" N01000="# returns with net capital gain (less loss)" A01000="Net capital gain (less loss) amount" N01400="# returns with taxable individual retirement arrangements distributions" A01400="Taxable individual retirement arrangements distributions amount" N01700="# returns with taxable pensions and annuities" A01700="Taxable pensions and annuities amount" SCHF="# farm returns" N02300="# returns with unemployment compensation" A02300="Unemployment compensation amount [5]" N02500="# returns with taxable Social Security benefits" A02500="Taxable Social Security benefits amount" N26270="# returns with partnership/S-corp net income (less loss)" A26270="Partnership/S-corp net income (less loss) amount" N02900="# returns with total statutory adjustments" A02900="Total statutory adjustments amount" N03220="# returns with educator expenses" A03220="Educator expenses amount" N03300="# returns with self-employment retirement plans" A03300="Self-employment retirement plans amount" N03270="# returns with self-employment health insurance deduction" A03270="Self-employment health insurance deduction amount" N03150="# returns with IRA payments" A03150="IRA payments amount" N03210="# returns with student loan interest deduction" A03210="Student loan interest deduction amount" N03230="# returns with tuition and fees deduction" A03230="Tuition and fees deduction amount" N03240="Returns with domestic production activities deduction" A03240="Domestic production activities deduction amount" N04470="# returns with itemized deductions" A04470="Total itemized deductions amount" A00101="Amount of AGI for itemized returns" N18425="# returns with State and local income taxes" A18425="State and local income taxes amount" N18450="# returns with State and local general sales tax" A18450="State and local general sales tax amount" N18500="# returns with real estate taxes" A18500="Real estate taxes amount" N18300="# returns with taxes paid" A18300="Taxes paid amount" N19300="# returns with mortgage interest paid" A19300="Mortgage interest paid amount" N19700="# returns with contributions" A19700="Contributions amount" N04800="# returns with taxable income" A04800="Taxable income amount" N05800="# returns with income tax before credits" A05800="Income tax before credits amount" N09600="# returns with alternative minimum tax" A09600="Alternative minimum tax amount" N07100="# returns with total tax credits" A07100="Total tax credits amount" N07300="# returns with foreign tax credit" A07300="Foreign tax credit amount" N07180="# returns with child and dependent care credit" A07180="Child and dependent care credit amount" N07230="# returns with nonrefundable education credit" A07230="Nonrefundable education credit amount" N07240="# returns with retirement savings contribution credit" A07240="Retirement savings contribution credit amount" N07220="# returns with child tax credit" A07220="Child tax credit amount" N07260="# returns with residential energy tax credit" A07260="Residential energy tax credit amount" N09400="# returns with self-employment tax" A09400="Self-employment tax amount" N10600="# returns with total tax payments" A10600="Total tax payments amount" N59660="# returns with earned income credit" A59660="Earned income credit amount [6]" N59720="# returns with excess earned income credit" A59720="Excess earned income credit (refundable) amount [7]" N11070="# returns with additional child tax credit" A11070="Additional child tax credit amount" N10960="# returns with refundable education credit" A10960="Refundable education credit amount" N06500="# returns with income tax" A06500="Income tax amount [8]" N10300="# returns with tax liability" A10300="Total tax liability amount [9]" N85330="# returns with additional Medicare tax" A85330="Additional Medicare tax amount" N85300="# returns with net investment income tax" A85300="Net investment income tax amount" N11901="# returns with tax due at time of filing" A11901="Tax due at time of filing amount [10]" N11902="# returns with overpayments refunded" A11902="Overpayments refunded amount [11]"; run; /* ==============================Footnotes copied from the tech doc for 2014 release====================================== G. Endnotes: [1] For complete individual income tax tabulations at the State level, see the historic table posted to Tax Stats at http://www.irs.gov/uac/SOI-Tax-Stats---Historic-Table-2. [2] Does not include returns with adjusted gross deficit. [3] “Qualified dividends” are ordinary dividends received in tax years beginning after 2002 that meet certain conditions and receive preferential tax rates. The maximum qualified dividends tax rate is 15%. [4] Includes the Alaskan permanent fund, reported by residents of Alaska on Forms 1040A and 1040EZs. This fund only applies to statistics in the totals, and the state of Alaska. [5] Earned income credit includes both the refundable and non-refundable portions. The non-refundable portion could reduce income tax and certain related taxes to zero. The earned income credit amounts in excess of total tax liability, or amounts when there was no tax liability at all, were refundable. See footnote 6 below for explanation of the refundable portion of the earned income credit. [6] The refundable portion of the earned income credit equals total income tax minus the earned income credit. If the result is negative, this amount is considered the refundable portion. No other refundable credits were taken into account for this calculation. [7] Income tax reflects the amount reported on Form 1040 line 55. It also includes data from Form 1040A and 1040EZ filers. [8] “Total tax liability” differs from “Income tax”, in that “Total tax liability” includes the taxes from recapture of certain prior-year credits, tax applicable to individual retirement arrangements (IRA's), social security taxes on self-employment income and on certain tip income, advanced earned income payments, household employment taxes, and certain other taxes listed in the Form 1040 instructions. [9] Reflects payments to or withholdings made to "Total tax liability". This is the amount the tax filer owes when the income tax return is filed. [10] The amount of overpayments the tax filer requested to have refunded. ===================================End Footnotes========================================================================= */; options ps=90 ls=160; title2 "Data Per irstaxes.&setname Data Set"; proc print data=irstaxes.&setname(obs=50); title3 "First 50"; by taxyear state stab; id zipcode areaname agi; run; proc means data =irstaxes.&setname n mean sum max; title3 "proc means"; class sumlev agi; run; proc datasets library=irstaxes nolist; modify &setname ; index create state; quit; *---decided not to create mo subset views of these sets---; %mend dozips; *---------------------end step 2 (zip1)---------------*; **********************Step 3: Do enhanced ("plus") data sets*******************************************; *---The basic raw data in the files / data sets distributed by the IRS do not contain any variables that seem to us suitable for really getting a handle on the information they contain. Aggregate dollar values and counts of tax returns are only valuable when combined to look at averages, and then compared to some norm such as the corresponding state value for a sub-state area. So this step creates a series of custom "plus" data sets that parallel the original data sets but contain mostly means and percentage values derived from the raw return counts and dollar amounts. We also use mnemonic names in these sets: for example, N00200 is now Nwages and A00200 is now called AmtWages . The new variable AvgWages is calculated by dividing A00200 by N00200 and multiplying by 1000 (since the aggregate amt is in thousands). PctWages is also new and is calculated as the percentage of all returns that reported wages, i.e. 100*N00200/N1 . The new variable AvgTRWages is the average value of Wages if we use Total Returns as the denominator, i.e. it is the average value of wages on all returns, even if they did not report any wages. ***4-10-14: We are alerted to problem with these data. Cases occurred where the Amt and N values were (apparently) 0 but the corresponding Avg variable was showing $1,000. Turns out the apparent 0 values were actually .0001 values, which is what IRS assigns to values that would see better set to 0. See footnote 2 in the tech doc. In this conversion run we shall convert all the .0001 values to 0s and this should make the corresponding Avg variables have missing values. Documention section on Changes indicate that they are no longer using the .0001 value convention to indicate such values. We leave in the code to check for it anyway. ---*; options compress=binary; options mprint; %macro dogeos(geo,allno); %***let geo=cnty; %***let allno=no; %**local setname; %let setname=us&geo.s&allno.agi&yr; data irstaxes.us&geo.splus&allno.agi&yr (label="Enhanced &year Income Tax data by &geo, &allno AGI Grps" ); set irstaxes.&setname; Rename N1=TotRtrns N2=Nexempts MARS1=SNGLRtrns MARS2=MJRtrns MARS4=HHRtrns PREP=PrepRtrns A00100=AmtAGI; if N1 then do; AvgAGI=round(A00100*1000/N1); PctJoint=100*MARS2/N1; PctPrep=100*PREP/N1; AvgExempts=N2/N1; AvgDepends=NUMDEP/N1; Label AvgAGI='Average AGI ($)' A00100='Total AGI ($000)' PctJoint='% Married Couple Joint Returns' PctPrep='% w Paid Preparer Sig' AvgExempts='Avg # Exemptions' AvgDepends='Avg # Dependents'; end; %macro newvar(sfx,name,what); %let lsfx=%length(&sfx); %if &lsfx=3 %then %let sfx=00&sfx; %else %if &lsfx=4 %then %let sfx=0&sfx; if round(n&sfx,.0001)=.0001 then do; n&sfx=0; A&sfx=0; end; N&name=n&sfx; Amt&name=A&sfx; %local pctname; %if %substr(&name,1,4)=%str(With) %then %let pctname=Pct&name; %else %let pctname=PctWith&name; if N1 then &pctname = 100*N&name/N1; if N&name then Avg&name=Amt&name*1000/N&name; if N1 then AvgTR&name=Amt&name*1000/N1; Label N&name="N with &what" Amt&name="Amt &what ($000)"; Label Avg&name="Avg &what when > 0" avgtr&name="Avg &what all returns" &pctname="% reporting &what"; %mend newvar; drop n00200--a11902; *<=====Check to make sure a11902 stays as last input var; %newvar(200,wages,%str(Salaries & Wages)) %newvar(300,TxblInt,Taxable Interest) %newvar(600,OrdDiv,Ordinary Dividends) %newvar(650,QualDv,Qualified Dividends) %newvar(900,BusProInc,Business of Prof Net Income) NFarm=schf; label NFarm='# Farm Returns'; if N1 then PctFarm=100*Nfarm/N1; label PctFarm='% Farm Returns'; %newvar(1000,CapGain,%str(Capital Gain (less loss))) %newvar(1400,IRAdists,IRA Distributions) %newvar(1700,PensionsAnn,Pensions and Annuities) %newvar(2300,UnempComp,Unemployment Compensation) %newvar(2500,TaxableSS,Taxable Social Security Benefits) %newvar(3300,SelfEmpRet,Self Employment Ret Plans) %newvar(4470,Itemized,Itemized Deductions) AmtAGI_Itmzd=A00101; if n04470 then AvgAmtAGI_Itmzd=AmtAGI_Itmzd*1000/N04470; %newvar(18425,LocalIncTaxes,%str(St & Local Income Tax)) %newvar(18450,LocalSalesTaxes,%str(St & Local Sales Tax)) %newvar(18500,RealEstTaxes,Real Estate Taxes) %newvar(18300,TaxesPaid,Taxes Paid) %newvar(19300,MortInt,Mortgage Int Paid) %newvar(19700,Contribs,Contributions) %newvar(04800,TaxableIncome,Taxable Income) %newvar(7100,TaxCreds,Total Tax Credits) %newvar(7220,ChildCreds,Child Tax Credits) %newvar(7180,ChDepCareCreds,%str(Child & Dependent Care Credits)) %newvar(7260,AddChildCreds,Additional Child Tax Credits) %newvar(59660,EarnedIncCreds,Earned Income Credits) %newvar(59720,ExcEarnedIncCreds,Excess Earned Income Credits) %newvar(9600,AltMinTax,Alternate Minimum Tax) %newvar(6500,IncomeTax,Income Tax) %newvar(10300,Liability,Tax Liability[10]) %newvar(11901,TaxDue,Tax Due at Filing[11]) %newvar(11902,Refund,Refund Due[12]) *<==============================New variables for Tax Year 2013 =======================================; *--they said 20 new but we find only 19--; %newvar(02650,TotInc,Total Income ) %newvar(00700,LocalTaxRefund,State and local income tax refunds) %newvar(26270,PartnrshpNetInc,%str(Partnrshp/S-corp net income)) %newvar(02900,StatuaryAdj,Total statutory adjustments) %newvar(03220,EducatorExp,Educator expenses) %newvar(03270,SelfEmpHealthDdctn,%str(Self-employment health insurance deduction)) %newvar(03150,IRApymnts,IRA payments) %newvar(03210,StudentLoanIntDdctn,Student loan interest deduction) %newvar(03230,TuitionFeesDdctn,Tuition and fees deduction) %newvar(03240,DomProdActvtyDdctn,Domestic production activities deduction) %newvar(05800,IncTaxBC,Income tax before credits) %newvar(07300,ForeignTaxCredit,Foreign tax credit) %newvar(07230,NonRefndblEdCred,Nonrefundable education credit) %newvar(07240,RetSavingsContrib,Retirement savings contribution credit) %newvar(09400,SelfEmpTax,Self-employment tax) %newvar(10600,TotTaxPymnts,Total tax payments) %newvar(10960,RefndblEdCred,Refundable education credit) %newvar(85330,AddlMedicareTax,Additional Medicare tax) %newvar(85300,NetInvestIncTax,Net investment income tax) *<==============================New variables for Tax Year 2014 =======================================; %newvar(05780,ExcessPremiumTCR,Excess advance premium tax credit repayment) %newvar(09750,HCareIndRespPymnt,Health care responsbility payment) %newvar(85770,TotPremTaxCred,Total Premium tax credit) %newvar(85775,AdvancePremTaxCred,Advance Premium tax credit) %newvar(11560,NetPremTaxCred,Net Preium tax credit) format Pct: 5.1 Avg: dollar9. Amt: dollar11. N: comma9. ; format AvgExempts AvgDepends 4.1; run; %mend dogeos; options SOURCE; *---Ready to invoke the macros to do the conversions---; *--we have data at 2 levels (cnty and zip) and 2 "types" - as recieved and "plus" sets (handled by dogeos macro) --; %docntys(all); %docntys(no) ; %dozips(all); %*dozips(no); %dogeos(cnty,all) ; /*<=========================Comment out===================================== %dogeos(cnty,no) ; %dogeos(zip,no) ; %dogeos(zip,all) ; ===========================End commented out================================ */