x cd /pub/data/cbp/Tools; %let pgm=cnvtyy_naics_msaonly; filename pgm "&pgm..sas"; /*--This conversion setup used to convert NAICS-based data, starting with the 1998 data. We used cnvtyy.sas to convert 1997 and earlier. The data sets change starting with the 1998 data. The input here is a 3-file .zip archive with the 3 txt files containing data for the US totals, states and counties. We typically (used to) get these files off the cd-rom in the ascii_files subdirectory. They were stored inside a directory of .EXE self-extracting files on the cd-rom. They have to be uploaded as-is to the cbp/exefiles subdirectory, which is where the macro expects to find them. Beginning with 2007 (2005 data) we download the files in .zip format from the Bureau web site -- http://www.census.gov/epcd/cbp/download/dwncbp05.html on 6-4-07, for example Fixing some problems with the conversion macro (new naic02_ format code, using a cbpemp format code fot totemp and fixing some labels and lengths, 6-6-07. Also enhancing geographic codes by merging cbsa related codes from georef.cbsacos (which in 07 had codes as of 2005). Will need to rerun all conversions back to 99. jgb, 6-6-07 Jan, 2008: new code used to convert data at msa (cbsa) level for us. For 2003-2005 initially. Oct, 2008: convert data for 2006 msa. (the value of pgm was wrong when we started today, 10-4-08)!! It left off _msaonly ). ---*/ libname user '/SAS_temp/userb'; libname cbp '/pub/data/cbp'; %let yy=06; %let year=2006; options mprint; *<====while debugging only--; title "Conversion Run for &year County Business Patterns Data (MSA only)dd"; options nocenter ps=58 noovp; *---the conversion macro is in /pub/sas/macros/cbpcnvt.sas and does most of the work---; *---We put the conversion step inside a macro to automate rerunning 7 years of data. Normally not needed, can just run the 3 cbpcnvt macros from open code. --; ***proc datasets library=cbp; %macro doyears(startyr,endyr); %global yy year; %do iyear=&startyr %to &endyr; %let yy=%substr(&iyear,3,2); %let year=&iyear; *************Metro Areas data***********; %cbpcnvt(files=msa,yr=&yy) %end; %*--of do iyear loop---; %mend doyears; %doyears(2006,2006); *<---msa only conversion---; run;