x cd /pub/data/irstaxes/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for this directory.
*<==== We just do the original collection of sets in this setup. We do the "plus" datasets in invoke_dosets_plus.sas .
=======================================================================================================================
J. Blodgett, OSEDA, Feb, 2014,
Updated ..
-- */
title "Job to Invoke doset Macro for Sets in irstaxes, creating irstaxes.datasets";
libname irstaxes '/pub/data/irstaxes';
%let libnameg=irstaxes;
%let todo=;
*-----Run this step ONLY ONCE------------------------------------------;
*----If you need to rerun (start over) then delete the datasets dataset first. doset will not
allow initialize mode if the datasets set already exists.---;
%**doset(mode=initialize,
libname=irstaxes,debug=1);
%let year=2011;
%let yr=%substr(&year,3,2);
*----------------------------------------------------------------------;
*----------------------------Do all the "not plus" original data sets with IRS var names (4 per year)-----------------;
*---We do zipsall, zipsno, cntyall, cntyno--*;
%doset(mode=,libname=irstaxes,
memname=uszipsallagi&yr,
geouniv=US,
units=%str(state ZIP),
Years=&year,
CreatePgm=cnvt_irstaxes,
Keywords=&year IRS tax returns ZIP codes income,
Description=%nrbquote(Summary of tax returns for &year at ZIP and State levels w AGI interval detail),
keyvars=sumlev state agi_stub,
keyfmats=%str(sumlev state | ),
keyIdvars=%str( | | agi),
DataSource=%str(Internal Revenue Service, SOI Division),
SortedBy=State SumLev ZIPcode agi_stub,
UsageNotes=%nrbquote(
- Most observations summarize 1 Adjusted Gross Income interval (agi) for a ZIP code
based on (almost - see techdoc) all tax returns for year &year . When ZIP is
00000 then SumLev will have a
value of 040 and the data are a state-level summary (for the specified AGI).
- Note that the agi variable contains the 1-digit code followed by the description of the AGI dollar interval.
- Note footnote 2 in the tech doc re use of .0001 value to indicate a value that may have been combined with another AGI class
or reported in a 99999 group. When the N variable is .0001 the value of the A variable will be the same.
- Variable names mostly conform to those used in the zpdoc.doc file. A key exception is State (which is the FIPS code
for us while Stab contains the postal abbreviation.) We added AreaName.
- A companion data set summarizes all returns regardless of the AGI class (replace "allagi" with "noagi" in set name).
- See http://www.irs.gov/uac/Tax-Stats-2 for background info and other related data.
- Data set had to be regenerated after errors were discovered in original downloaded files. Fix made 4-30-14.
),
SubType=zip2allagi,
SetGroup=us,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/11zpdoc.doc),
debug=0);
%doset(mode=,libname=irstaxes,
memname=uszipsnoagi&yr,
geouniv=US,
units=%str(state ZIP),
Years=&year,
CreatePgm=cnvt_irstaxes,
Keywords=&year IRS tax returns ZIP codes income,
Description=%nrbquote(Summary of tax returns for &year at ZIP and State levels - NO AGI interval detail),
keyvars=sumlev state,
keyfmats=%str(sumlev state ),
DataSource=%str(Internal Revenue Service, SOI Division),
SortedBy=State SumLev ZIPcode ,
UsageNotes=%nrbquote(- Most observations summarize a ZIP code
based on (almost - see techdoc) all tax returns for year &year . When ZIP is
00000 then SumLev will have a
value of 040 and the data are a state-level summary.
- Variable names mostly conform to those used in the zpdoc.doc file. A key exception is State (which is the FIPS code
for us while Stab contains the postal abbreviation.) We added AreaName.
- Note footnote 2 in the tech doc re use of .0001 value to indicate a value that may have been combined with another AGI class
or reported in a 99999 group. When the N variable is .0001 the value of the A variable will be the same.
- A companion data set summarizes returns within 6 AGI classes (replace "noagi" with "allagi" in set name).
- See http://www.irs.gov/uac/Tax-Stats-2 for background info and other related data.
- Data set had to be regenerated after errors were discovered in original downloaded files. Fix made 4-30-14.
),
SubType=zip2noagi,
SetGroup=us,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/11zpdoc.doc),
debug=0);
*==============================End of ZIP sets, begin county sets====================================================*;
%doset(mode=,libname=irstaxes,
memname=uscntysallagi&yr,
geouniv=US,
units=%str(state County),
Years=&year,
CreatePgm=cnvt_irstaxes2,
Keywords=&year IRS tax returns County codes income,
Description=%nrbquote(Summary of tax returns for &year at County and State levels w AGI interval detail),
keyvars=sumlev state agi_stub,
keyfmats=%str(sumlev state | ),
keyIdvars=%str( | | agi),
DataSource=%str(Internal Revenue Service, SOI Division),
SortedBy=State SumLev County agi_stub,
UsageNotes=%nrbquote(- Most observations summarize 1 Adjusted Gross Income interval (agi) for a County code
based on (almost - see techdoc) all tax returns for year &year . When County is
00000 then SumLev will have a
value of 040 and the data are a state-level summary (for the specified AGI).
- Note footnote 2 in the tech doc re use of .0001 value to indicate a value that may have been combined with another AGI class
or reported in a 99999 group. When the N variable is .0001 the value of the A variable will be the same.
- Note that the agi variable contains the 1-digit code followed by the description of the AGI dollar interval.
- Variable names mostly conform to those used in the incydoc.doc file. A key exception is State (which is the FIPS code
for us while Stab contains the postal abbreviation.)
- A companion data set summarizes all returns regardless of the AGI class (replace "allagi" with "noagi" in set name).
- See http://www.irs.gov/uac/Tax-Stats-2 for background info and other related data.
),
SubType=cnty2allagi,
SetGroup=us,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/11incydoc.doc),
debug=0);
%doset(mode=,libname=irstaxes,
memname=uscntysnoagi&yr,
geouniv=US,
units=%str(state County),
Years=&year,
CreatePgm=cnvt_irstaxes2,
Keywords=&year IRS tax returns County codes income,
Description=%nrbquote(Summary of tax returns for &year at County and State levels - NO AGI interval detail),
keyvars=sumlev state,
keyfmats=%str(sumlev state ),
DataSource=%str(Internal Revenue Service, SOI Division),
SortedBy=State SumLev County ,
UsageNotes=%nrbquote(- Most observations summarize a county
based on (almost - see techdoc) all tax returns for year &year . When County is
00000 then SumLev will have a
value of 040 and the data are a state-level summary.
- Note footnote 2 in the tech doc re use of .0001 value to indicate a value that may have been combined with another AGI class
or reported in a 99999 group. When the N variable is .0001 the value of the A variable will be the same.
- Variable names mostly conform to those used in the incydoc.doc file. A key exception is State (which is the FIPS code
for us while Stab contains the postal abbreviation.)
- A companion data set summarizes returns within 6 AGI classes (replace "noagi" with "allagi" in set name).
- See http://www.irs.gov/uac/Tax-Stats-2 for background info and other related data.
),
SubType=cnty2noagi,
SetGroup=us,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/11incydoc.doc),
debug=0);
proc sort data=irstaxes.datasets out=bysortprio; by sortprio; run;
proc print data=bysortprio;
by libname notsorted libpath ;
id memname;
var SortPrio SetGroup SubType VarSet URLmeta GeoUniv years ;
title2 'Listing of Selected Fields from irstaxes.datasets (Sorted by SortPrio)';
run ;
proc datasets library=irstaxes nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options NOmprint msglevel=i;
%gendshtm(libname=irstaxes,debug=0,runprocc=0);
*--------------------See invoke_dosets_plus for the setup to document the "plus" sets----;