x cd /pub/data/bls_la/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, Feb, 2007
Revised and rerun 7-08. And again 3-09.
Revised and run to document new data 6-13 .
-- */
%include '/pub/sas/autoexec.sas';
options mprint symbolgen;
title "Job to Invoke doset Macro for Sets in bls_la, creating bls_la.datasets";
libname bls_la '/pub/data/bls_la';
/*<=========================Comment out=====================================
proc datasets lib=bls_la nolist;
modify datasets;
index create dataset=(libname memname) / unique;
quit;
===========================End commented out================================ */
%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=bls_la,debug=1);
*----------------------------------------------------------------------;
/*<=========================Comment out=====================================
%doset(mode=,libname=bls_la,
memname=_template_stcnty,
geouniv=,
units=state county year seasonal,
Year=1976 thru xxxx,
CreatePgm=bls_la_cnvt,
Keywords=bls unemployment jobs,
Description=%nrbquote(Unemployment data by Year for State and County with monthly and annual avg data),
keyvars=sumlev state county year Seasonal cbsa cbsatype cbsayr,
keyfmats=sumlev state county | | cbsa | | ,
keyquals=,
sortedby=State SumLev County Year Seasonal,
DataSource=%str(U.S. Bureau of Labor Statistics),
UsageNotes=%nrbquote(
- Data were downloaded March, 2009 and have monthly data thru Dec 2008 but without annual
averages for 2008. Data for Dec 08 is preliminary.
- In a do-over conversion done 3-13-09 we filled in the missing 2008 annual avgs by doing the arithmetic on the monthly data.
- Each row/obs represents data for a geographic area for a year with extra rows at the state level for seasonally adjusted data.
- State level summaries go back to 1976, while county level data may go back as far as 1990.
- The 4 statistic types are emp, unemp, clf and uerate: employed, unemployed, civ labor force and unemployment rate.
Variable names use these base names with suffixes M1 to M12 indicating Jan thru Dec and Avg to indicate Annual Avg.
E.G. empM11 is employed persons November, while uerateAvg is the unemployment rate annual average.
- Variables AreaCode, AreaType1, AreaType, Display_level, Selectable and Sort_Sequence are from the
BLS files and are not fully documented. We keep them out of fear that they have some importance but so far we have not found any.
- FIPS county codes were added to these data using a cross-walk file provided by the BLS. We used these codes to link to
our georef.cbsacos dataset (November 2007 revision) in order to add metropolitan and micropolitan area (CBSA) codes.
- When aggregating uerate variables, use corresponding clf variables as weights.
),
SubType=stcnty,
SetGroup=,
VarSet=,
URLMeta=,
filters=,
debug=0)
%doset(mode=,libname=bls_la,
memname=usstcnty13,
geouniv=%str(United States + PR),
units=state county year seasonal,
Year=1976 thru 2013,
CreatePgm=bls_la_cnvt,
Keywords=bls unemployment jobs,
Description=%nrbquote(Unemployment data by Year for State and County with monthly and annual avg data),
keyvars=sumlev state county year Seasonal cbsa cbsatype cbsayr,
keyfmats=sumlev state county | | cbsa | | ,
keyquals=,
sortedby=State SumLev County Year Seasonal,
DataSource=%str(U.S. Bureau of Labor Statistics),
UsageNotes=%nrbquote(- Data were downloaded June, 2013 and have monthly data thru April 2013.
- Each row/obs represents data for a geographic area for a year with extra rows at the state level for seasonally adjusted data.
- State level summaries go back to 1976, while county level data may go back as far as 1990.
- The 4 statistic types are emp, unemp, clf and uerate: employed, unemployed, civ labor force and unemployment rate.
Variable names use these base names with suffixes M1 to M12 indicating Jan thru Dec and Avg to indicate Annual Avg.
E.G. empM11 is employed persons November, while uerateAvg is the unemployment rate annual average.
- Variables AreaCode, AreaType1, AreaType, Display_level, Selectable and Sort_Sequence are from the
BLS files and are not fully documented. We keep them out of fear that they have some importance but so far we have not found any.
- FIPS county codes were added to these data using a cross-walk file provided by the BLS. We used these codes to link to
our georef.cbsacos dataset (February 2013 revision) in order to add metropolitan and micropolitan area (CBSA) codes.
- When aggregating uerate variables, use corresponding clf variables as weights.
),
SubType=stcnty,
SetGroup=,
VarSet=,
URLMeta=,
filters=, sortprio=1,
debug=0)
%doset(libname=bls_la,memname=mostcnty13,description=%str(Missouri State and County Level Summaries, 2013 Edition),
UsageNotes=%nrbquote(- This is just a subset view of the corresponding usstcnty13 data set.
),
geouniv=%str(Missouri),
units=state county year seasonal,
Year=1976 thru 2013,
CreatePgm=bls_la_cnvt,
Keywords=bls unemployment jobs Missouri,
keyvars=sumlev state county year Seasonal cbsa cbsatype cbsayr,
keyfmats=sumlev state county | | cbsa | | ,
sortprio=2)
===========================End commented out================================ */
%macro doavgs(year);
%let yr=%substr(&year,3,2);
%doset(libname=bls_la,memname=uscountyavgs&yr,description=%str(US County Data with &year Annual Avg unemployment),
UsageNotes=%nrbquote(- Much simplified data set vs usstcntyYY sets. Just 4 basic measures: CLF, employed,
Unemployed and UE rate.
- No monthly or seasonal data here. Just annual averages for the complete year.
- Companion dataset usstateavgs&yr has comparable data at the nation and state levels.
- We have a number of these data sets for different years. Use wildcard processing to access data for multiple years.
Uses data downloaded from http://www.bls.gov/lau/#cntyaa : Labor Force data by county, &year annual averages
),
geouniv=%str(United States + PR),
units=county,
Year=&year,
CreatePgm=bls_laucntyxx,
Keywords=bls unemployment rate jobs,
keyvars=state year,
keyfmats=state |,
setgroup=lau) ;
*--Now do the set with nation and state data--;
%doset(libname=bls_la,memname=usstateavgs&yr,description=%str(US nation and state Data with &year Annual Avg unemployment),
UsageNotes=%nrbquote(- Much simplified data set vs usstcntyYY sets. Just 4 basic measures: CLF, employed,
Unemployed and UE rate.
- No monthly or seasonal data here. Just annual averages for the complete year.
- Companion dataset uscountyavgs&yr has comparable data at the county level.
- We have a number of these data sets for different years. Use wildcard processing to access data for multiple years.
Uses data downloaded from http://www.bls.gov/lau/#cntyaa : Labor Force data by county, &year annual averages
),
geouniv=%str(United States + PR),
units=nation state,
Year=&year,
CreatePgm=bls_laucntyxx,
Keywords=bls unemployment rate jobs,
keyvars=state year,
keyfmats=state |,
setgroup=lau) ;
%mend doavgs;
%doavgs(2017) ;
/*<=========================Comment out=====================================
%doavgs(2016) ;
%doavgs(2015) ;
%doavgs(2014) ;
%doavgs(2013) ;
%doavgs(2012) ;
%doavgs(2011) ;
%doavgs(2010) ;
%doavgs(2009) ;
%doavgs(2008) ;
%doavgs(2000) ;
%doavgs(1990) ;
===========================End commented out================================ */
proc datasets library=bls_la nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
proc sort force data=bls_la.datasets nodupkey;
by Years descending setgroup memname;
run;
%gendshtm(libname=bls_la,debug=1,runprocc=1);