x cd /pub/data/acs2008/Tools; %let pgm=create_basetbls; filename pgm "&pgm..sas"; *---This job was only used to process the single-year data for 2008. We coded a separate create_basetbls3yr.sas setup 5-7-10 to do similar processing of the 3yr data. We eventually want to modify and rerun this setup so that the geographic variables are also kept on the moe datasets as well, making it easier for users to run parallel extracts. jgb, 5-7-10---; *---The base tables data sets are mostly created by Billy Earny on the new platform and are copied to the P: drive from which they are uploaded and stored in the temp directory. The allgeos data set also is stored there and is converted to the final copy by the create_allgeos setup in this program library. In this setup we create the final, permanent basetbls datasets by merging and renaming the ustabs datasets in temp with the final allgeos dataset. To summarize the process of creating the acs2008\basetbls data sets: 1. bce downloads the raw data from CB web site. These get converted to mysql and then to sas datasets. These are then copied to the P: drive (\mcdc\acs2008\basetbls ). These have the basic data but need work regarding some naming conventions and the addition of standard geographic data. 2. The state level geographic data files are processed by bce to create an allgeos dataset which is also copied to the P: drive, basetbls folder. 3. Setup upload_edit_basetbls.sas is created (in the above basetbls directory on P:) and is run to upload the basetbls datasets to /pub/data/temp on this AIX site. We also upload a copy of that sas program file to this (Tools) directory. 4. We run the create_allgeos.sas setup here to access the uploaded temp.allgeos dataset and do final enhancements to it, creating acs2008.allgeos dataset. 5. This job creates the ustabsXXXXX datasets in /pub/data/acs2008/basetbls by merging the temp.ustabsXXXX datasets with the acs2008.allgeos dataset. Following this job you need to run 6. Run create_basetbls_metadata08.sas to create the variablesxxxx data sets and the Varlabs .txt files. We expect to repeat this cylce for the 3-yr period data when it becomes available. jgb, 9-30-09 ---*; %let period=3yr; %let subdir=%str(3yr/); %let period=%str(); %let subdir=%str(1yr/); %let year=2008; %let yr=%substr(&year,3,2); %let yearm1=%eval(&year-1); title "&pgm.: Create Final &year &period Base Tables Datasets"; libname acs&year "/pub/data/acs&year"; *<====; libname temp '/pub/data/temp'; libname basetbls "/pub/data/acs&year/basetbls"; options compress=binary; *<==================================Check to see of the temp datasets have the same names for current data*******************; %macro dotabs(tbls); data basetbls.ustabs&tbls&period(index=(geoid)); merge acs&year..allgeos(in=ingeos keep=SumLev--LogRecno) temp.ustabs&tbls._estimates(in=indata keep=geoid _numeric_ rename=(logrecno=_logrecnock)); by geoid; if not (ingeos and indata) or logrecno ne _logrecnock then do; put '****We have a problem with the merge: data is missing or inconsistent*** ' geoid= areaname= ingeos= indata= logrecno= _logrecnock= ; abort abend; end; drop _: ; run; *--and just copy the moes datasets--; data basetbls.ustabs&tbls._moes. set temp.ustabs&tbls._moes; run; data _null_; file log; put "**** &tbls datasets successfully processed ****" ; file stdout; put "**** &tbls datasets successfully processed ****" ; run; %mend dotabs; options mprint; %dotabs(00_07) %dotabs(08) %dotabs(09_16) %dotabs(17_20) %dotabs(21_24) %dotabs(25_27)