x cd /pub/data/eeo2000/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for this directory.
J. Blodgett, OSEDA, Dec., 2003
-- */
title "Job to Invoke doset Macro for Sets in eeo2000, creating eeo2000.datasets";
libname eeo2000 '/pub/data/eeo2000';
%let filetype=eeo2000;
*-----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=eeo2000,debug=1);
*----------------------------------------------------------------------;
/*<=========================Comment out=====================================
*---------------------Table Group A------------------------------------;
*---Define template for the first 7 datasets, the "A" group (based on residence geography)---;
%doset(mode=,libname=eeo2000,
memname=_template_a,
memlabel=,
units=,
Year=2000,
CreatePgm=cnvttbls,
Keywords=census 2000 eeo occupation workforce employment race hispanic,
Keyvars= SumLev GeoCode State csarea msapmsa ~occvar,
Keyfmats=Sumlev eeogeo state csarea msapmsa ~occfmt,
Description=%nrbquote(Custom tabulations of the Civilian Labor Force Aggregated by residential geography. ),
DataSource=%str(2000 Census - EEO Special Tab Product rel. Dec/2003),
SortedBy=SumLev Geocode,
UsageNotes=%nrbquote(
- Summaries are of the Civilian Labor Force 16 years and older, ESR (Employment
Status Recode) 1-3.
- All geography pertains to the residence of the worker (not the work site).
- These are the tables with 12 Race/Ethnic categories. There are comparable tables with 15 categories as used in Hawaii
available from the Census Bureau, but not here.
- All of the race categories are qualified by Hispanic. You can not get complete race counts.
),
SubType=,
SetGroup=us,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/applications/uexplore.php?/pub/data/eeo2000/sas_doc),
debug=0)
*------------------Table 1-----------------------------*;
%let occvar=cenocc; %let occfmt=cenocc;
%doset(libname=&filetype,
memname=ustable1,template=_template_a,
memlabel=%nrbquote(472 Census Occ. Categories by Residence down to County Sets),
geouniv=United_States,
units=US State MSA PMSA CountySet,
Description=%nrbquote(+ This is one of the largest non-flow datasets with very detailed occupation
data (472 census codes), and 4 levels of geography down to counties of 50,000+ and County Sets. Data for
the usual 12 EEO
Race/Hispanic categories by Sex.),
UsageNotes=%nrbquote(+- There are 24 cells in the t1 table: 12 Race/Hispanic characters by 2 Sex categories.
- The County Sets summary level (901) has data for individual counties of 50,000 or more population.
- The total variable has the count of all persons for the geography / occupation code category
and is rather frequently 0. Users may wish to filter cases where totpop=0.
),
SubType=table1,
SetGroup=us) ;
%doset(libname=&filetype,
memname=motable1,template=ustable1,
geouniv=Missouri,sortprio=1,
units=State CountySet,
Keyvars= SumLev GeoCode State csarea &occvar,
Keyfmats=Sumlev eeogeo state csarea &occfmt,
UsageNotes=%nrbquote(+- This is just a subsetting view of the ustable1 dataset using the filter:
State EQUALS 29 )
,
setgroup=mo);
*------------------Table 2-----------------------------*;
%let occvar=opm; %let occfmt=opmocc;
%doset(libname=&filetype,
memname=ustable2,template=_template_a,
memlabel=%nrbquote(268 OPM Occ. Categories by Residence down to County Sets),
geouniv=United_States,
units=US State MSAs PMSA CountySet,
Description=%nrbquote(+ This is one of the larger non-flow datasets with 268 OPM Federal Workforce
occupation groups and the same 4 levels of geography as Table 1. Data for
the usual 12 EEO
Race/Hispanic categories by Sex.),
UsageNotes=%nrbquote(+
- Table 2 is basically the same as Table 1 but with OPM categories instead of Census detailed categories.
- There are 24 cells in the t2 table: 12 Race/Hispanic characters by 2 Sex categories.
- The County Sets summary level (901) has data for individual counties of 50,000 or more population.
- The total variable has the count of all persons for the geography / occupation code category
and is rather frequently 0. Users may wish to filter cases where totpop=0.
),
SubType=table1,
SetGroup=us) ;
%doset(libname=&filetype,
memname=motable2,template=ustable2,
geouniv=Missouri,sortprio=1,
units=State CountySet,
Keyvars= SumLev GeoCode State csarea &occvar,
Keyfmats=Sumlev eeogeo state csarea &occfmt,
UsageNotes=%nrbquote(+- This is just a subsetting view of the ustable2 dataset using the filter:
State EQUALS 29 )
,
setgroup=mo);
*------------------Table 5-----------------------------*;
%let occvar=st_loc; %let occfmt=stloc;
%doset(libname=&filetype,
memname=ustable5,template=_template_a,
memlabel=%nrbquote(8 State & Local Govt Occ. Cats by Residence down to County & large place),
geouniv=United_States,
units=US State MSA PMSA County Place50k,
keyvars=SumLev GeoCode State County Place MsaPmsa &occvar,
Keyfmats=Sumlev eeogeo state county fplace msapmsa &occfmt,
Keyquals= | | | | state,
Description=%nrbquote(+ State and Local Job Categories (8) for US, states, counties, metro areas and places
of 50,000 or more. Data for
the usual 12 EEO
Race/Hispanic categories by Sex.),
UsageNotes=%nrbquote(+
- There are 24 cells in the t5 table: 12 Race/Hispanic characters by 2 Sex categories. (Same as Tables 1 and 2).
),
SubType=table5,
SetGroup=us) ;
%doset(libname=&filetype,
memname=motable5,template=ustable5,
geouniv=Missouri,sortprio=1,
units=State County Place50k,
Keyvars= SumLev GeoCode State County Place &occvar,
Keyfmats=Sumlev eeogeo state county fplace &occfmt,
Keyquals= | | | | state,
UsageNotes=%nrbquote(+- This is just a subsetting view of the ustable5 dataset using the filter:
State EQUALS 29 )
,
setgroup=mo);
*------------------Table 6-----------------------------*;
%let occvar=; %let occfmt=;
%doset(libname=&filetype,
memname=ustable6,template=_template_a,
memlabel=%nrbquote(Younger Age Groups & Ed Attainment for Counties & Places of 50k+),
geouniv=United_States,
units=County Place50k,
Keywords=census 2000 eeo workforce race hispanic age education,
keyvars=SumLev GeoCode State County Place &occvar,
Keyfmats=Sumlev eeogeo state county fplace &occfmt,
Keyquals= | | | | state,
Description=%nrbquote(+Younger Age Groups, Educational Attainment, Race/Ethnicity and Sex for
all counties and places of 50,000 or more.
See Appendix 4.2
for category detail.),
UsageNotes=%nrbquote(+
- No occupation information in this table.
- There are 480 cells in the t6 table: Race/Hispanic(12) by Sex(2) by Younger Age Groups(4)
by Educational Attainment(5).
),
SubType=table6,
SetGroup=us) ;
%doset(libname=&filetype,
memname=motable6,template=ustable6,
geouniv=Missouri,sortprio=1,
units=County Place50k,
Keyvars= SumLev GeoCode State County Place &occvar,
Keyfmats=Sumlev eeogeo state county fplace &occfmt,
Keyquals= | | | | state,
UsageNotes=%nrbquote(+- This is just a subsetting view of the ustable6 dataset using the filter:
State EQUALS 29 )
,
setgroup=mo);
*------------------Table 7-----------------------------*;
%let occvar=; %let occfmt=;
%doset(libname=&filetype,
memname=ustable7,template=_template_a,
memlabel=%nrbquote(Younger Age Groups & Ed Attainment for US, States & Metros),
geouniv=United_States,
units=US State MSA PMSA,
Keywords=census 2000 eeo workforce race hispanic age education,
keyvars=SumLev GeoCode State msapmsa &occvar,
Keyfmats=Sumlev eeogeo state msapmsa &occfmt,
Keyquals=,
Description=%nrbquote(+Younger Age Groups, Educational Attainment(6), Race/Ethnicity and Sex for
US totals, states and metro areas.
See Appendix 4.2
for category detail.),
UsageNotes=%nrbquote(+
- No occupation information in this table.
- There are 576 cells in the t7 table: Race/Hispanic(12) by Sex(2) by Younger Age Groups(4)
by Educational Attainment(6).
- Table t7 differes from table t6 by having an extra educational attainment category: you can get Masters
Degree separate from PhD/Prof degree. Geography is also different.
),
SubType=table7,
SetGroup=us) ;
%doset(libname=&filetype,
memname=motable7,template=ustable7,
geouniv=Missouri,sortprio=1,
units=County Place50k,
Keyvars= SumLev GeoCode State &occvar,
Keyfmats=Sumlev eeogeo state &occfmt,
Keyquals=,
UsageNotes=%nrbquote(+- This is just a subsetting view of the ustable7 dataset using the filter:
State EQUALS 29 )
,
setgroup=mo);
*---------------------Table Group B ------------------------------------;
*---Define template for tables 8 - 19 datasets, the "B" group (based on workplace / residence geography)---;
%doset(mode=,libname=eeo2000,
memname=_template_b,
memlabel=,
units=,
Year=2000,
CreatePgm=cnvttbls,
Keywords=census 2000 eeo occupation workforce employment race hispanic,
Keyvars= SumLev GeoCode State csarea msapmsa ~occvar,
Keyfmats=Sumlev eeogeo state csarea msapmsa ~occfmt,
Description=%nrbquote(Custom tabulations of the Civilian Labor Force Aggregated by residential geography. ),
DataSource=%str(2000 Census - EEO Special Tab Product rel. Dec/2003),
UsageNotes=%nrbquote(- Summaries are of the Civilian Labor Force 16 years and older, ESR (Employment
Status Recode) 1-3.
- All geography pertains to the residence of the worker (not the work site).
- These are the tables with 12 Race/Ethnic categories. There are comparable tables with 15 categories as used in Hawaii
available from the Census Bureau, but not here.
- All of the race categories are qualified by Hispanic. You can not get complete race counts.
),
SubType=,
SetGroup=us,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/applications/uexplore.php?/pub/data/eeo2000/sas_doc),
debug=0)
*------------------Table 8-----------------------------*;
%let occvar=occvar; %let occfmt=occfmt;
%doset(libname=&filetype,
memname=ustable8,template=_template_b,
memlabel=%nrbquote(Younger Age Groups & Ed Attainment for US, States & Metros),
geouniv=United_States,
units=CountyCounty,
Keywords=,
keyvars= cenocc pow_geo_cty res_geo_cty racehsp qsex,
Keyfmats=cenocc eeocnty eeocnty eeorace eeosex ,
Keyquals=,
Description=%nrbquote(+Younger Age Groups, Educational Attainment(6), Race/Ethnicity and Sex for
US totals, states and metro areas.
See Appendix 4.2
for category detail.),
UsageNotes=%nrbquote(+
- No occupation information in this table
- There are 576 cells in the t7 table: Race/Hispanic(12) by Sex(2) by Younger Age Groups(4)
by Educational Attainment(6).
- Table t7 differes from table t6 by having an extra educational attainment category: you can get Masters
Degree separate from PhD/Prof degree. Geography is also different.
),
SubType=ustable8,
SetGroup=us) ;
%doset(libname=&filetype,
memname=motable8,template=ustable8,
geouniv=Missouri,sortprio=1,
units=CountyCounty,
Keyvars = cenocc pow_geo_cty res_geo_cty racehsp qsex,
Keyfmats= cenocc eeocnty eeocnty eeorace eeosex,
Keyquals=,
UsageNotes=%nrbquote(+- This is just a subsetting view of the ustable7 dataset using the filter:
State EQUALS 29 )
,
setgroup=mo);
===========================End commented out================================ */
*------------------Table 9-----------------------------*;
%let occvar=occvar; %let occfmt=occfmt;
%doset(libname=&filetype,
memname=ustable9,template=_template_b,
memlabel=%nrbquote(Younger Age Groups & Ed Attainment for US, States & Metros),
geouniv=United_States,
units=CountyCounty,
Keywords=,
keyvars= opm OccName pow_geo_cty res_geo_cty racehsp qsex,
Keyfmats=opmocc opmocc eeocnty eeocnty eeorace eeosex ,
Keyquals=,
Description=%nrbquote(+Younger Age Groups, Educational Attainment(6), Race/Ethnicity and Sex for
US totals, states and metro areas.
See Appendix 4.2
for category detail.),
UsageNotes=%nrbquote(+
- No occupation information in this table
- There are 576 cells in the t7 table: Race/Hispanic(12) by Sex(2) by Younger Age Groups(4)
by Educational Attainment(6).
- Table t7 differes from table t6 by having an extra educational attainment category: you can get Masters
Degree separate from PhD/Prof degree. Geography is also different.
),
SubType=ustable9,
SetGroup=us) ;
%doset(libname=&filetype,
memname=motable9,template=ustable9,
geouniv=Missouri,sortprio=1,
units=CountyCounty,
Keyvars = opm OccName pow_geo_cty res_geo_cty racehsp qsex,
Keyfmats= opmocc opmocc eeocnty eeocnty eeorace eeosex,
Keyquals=,
UsageNotes=%nrbquote(+- This is just a subsetting view of the ustable7 dataset using the filter:
State EQUALS 29 )
,
setgroup=mo);
*-------------------Alternative view datasets (radical restructurings)-------------------*;
%doset(libname=&filetype,
memname=altustable1,template=ustable1,
memlabel=%str(One-Obs-Per-Cell Alternate view of ustable1 data),
units=t1_table_cells,
sortprio=4,
keyvars=SumLev GeoCode State cenocc race hispanic rhtype,
keyfmats=sumlev eeogeo state cenocc | | | ,
description=%nrbquote(Experimental dataset in which we have replaced the 24-cell table of the ustable1
dataset with 1 obs per non-zero cell per geography/occupation code. Makes for a very long skinny dataset, one
that may be easier to use for some.),
UsageNotes=%nrbquote(- Values of variable Race (12) are mnemonic based on codebook (see Keyvars for values).
- Hispanic is a flag indicating if this cell counts hispanic workers (value is H) or non-hispanci (N). Blank for
rhtype 0 summaries.
- The rhtype variable indicates whether we have the usual Race/Hispanic combination summary from the original t1 table
cell (rhtype=2), or a derived Hispanic total (rhtype=1) or a derived total persons regardless of race/ethnicity (rhtype=0),
- socode variable (std occupation code) dropped to save space. Its value is contained within OccName.
- The t1 table has counts for males and females, but we added those to create the variable Total and kept the
Female count. You can easily get the Male count by subtracting Female from Total.
- Geoname and OccName are very handy because they identify the cell in terms of geographic area and occupational
category. They are stored as codes and use SAS format codes to display as descriptive labels. If you extract to a
csv or dbf file they become those strings and the files will be larger than the original SAS dataset. If you extract
them to a SAS dataset you will want to take the formats with you.
- State and geocode are the only two geographic codes kept, to save space. All you really need.
),
subtype=altview1,
setgroup=us,
debug=0);
%doset(libname=&filetype,
memname=altustable23,template=altustable1,
memlabel=%str(One-Obs-Per-Cell Alternate view of table23 data),
units=t23_table_cells,
sortprio=4,
keyvars=sumlev geocode workstate workcounty cenocc Industry rhtype race hispanic ,
keyfmats=sumlev eeogeo state eeocnty cenocc eeo_ind ,
description=%nrbquote(Detailed Occs x Industry x Race/Hisp x Sex-US, Cos & Plcs 100K+),
UsageNotes=%nrbquote(
- In this set we have replaced the 2112-cell table observations with 1 obs per non-zero cell
dataset with 1 obs per non-zero cell per geography/occupation code. Makes for a very long skinny dataset, one
that may be easier to use for some.
- Values of variable Race (12) are mnemonic based on codebook (see Keyvars for values).
- Hispanic is a flag indicating if this cell counts hispanic workers (value is H) or non-hispanci (N). Blank for
rhtype 0 summaries.
- The rhtype variable indicates whether we have the usual Race/Hispanic combination summary from the original t1 table
cell (rhtype=2), or a derived Hispanic total (rhtype=1) or a derived total persons regardless of race/ethnicity (rhtype=0),
- socode variable (std occupation code) dropped to save space. Its value is contained within OccName.
- The t1 table has counts for males and females, but we added those to create the variable Total and kept the
Female count. You can easily get the Male count by subtracting Female from Total.
- Geoname and OccName are very handy because they identify the cell in terms of geographic area and occupational
category. They are stored as codes and use SAS format codes to display as descriptive labels. If you extract to a
csv or dbf file they become those strings and the files will be larger than the original SAS dataset. If you extract
them to a SAS dataset you will want to take the formats with you.
- State and geocode are the only two geographic codes kept, to save space. All you really need.
),
subtype=altview1,
setgroup=us,
debug=0);
x cd /pub/data/eeo2000/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for this directory.
J. Blodgett, OSEDA, Dec., 2003
-- */
title "Job to Invoke doset Macro for Sets in eeo2000, creating eeo2000.datasets";
libname eeo2000 '/pub/data/eeo2000';
%let filetype=eeo2000;
*-----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=eeo2000,debug=1);
*----------------------------------------------------------------------;
proc sort data=eeo2000.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 eeo2000.datasets (Sorted by SortPrio)';
run ;
proc datasets library=eeo2000 nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options mprint msglevel=i;
%gendshtm(libname=eeo2000,debug=1,runprocc=1);
%include sascode(notify);