x cd /pub/data/acspums/Tools; %let pgm=acs20083yr; filename pgm "&pgm..sas"; *---Access 3yr ACS PUMS sas datasets for the 2006-2008 period. As downloaded from AFF site, 12-21-09, jgb Just doing the Missouri files for now. ****the two psam_[hp]29 datasets referenced here will be deleted after this runs. They can be put back by using unzip on the unix_pmo.zip and uniz_hmo.zip files which were downloaded from http://factfinder.census.gov/home/en/acs_pums_2008_3yr.html 10-21-10: Making conversion code a macro with a proc tabulate step added. Processed Illinois 3yr data for 08. 11-11-10: reconverting from freshly downloaded data sets that were updated following discovery of minor errors. ---*; libname acspums '/pub/data/acspums'; libname dwnlds '/pub/data/acspums/updatedownloads2008'; %let year=2008; %let yr=%substr(&year,3,2); options compress=char; %macro doit(state,stab); %let upstab=%upcase(&stab); data acspums.&stab.hrecs&yr.3yr(label="&upstab H recs data for 3-year period ending 20&yr" ); set dwnlds.psam_h&state; run; data acspums.&stab.precs&yr.3yr(label="&upstab P recs data for 3-year period ending 20&yr" ); set dwnlds.psam_p&state; run; proc tabulate data=acspums.&stab.precs&yr.3yr; class puma; by st; format st $state.; var pwgtp; table (all puma), pwgtp*sum*f=comma13.; title "Summing Weight Variables on acspums.&stab.precs&yr.3yr"; run; %mend doit; %doit(29,mo); %doit(17,il);