x cd /pub/data/acspums/Tools; %let pgm=acs20xx; filename pgm "&pgm..sas"; /* Access Unix sas datasets for the 20&yr pums for Mo & US. As downloaded from Census Bureau FTP site, https://www2.census.gov/programs-surveys/acs/data/pums/YYYY/1-Year/ where YYYY is the year. Download only the US and MO SAS zip files (sas_pus.zip, sas_pmo.zip, sas_hus.zip, sas_hmo.zip) Not much conversion going on here. We are mostly just copying and compressing to save space. 10-20-16: Downloaded the 2015 vintage 1-year data from another page at AFF site. 11-17-16: Processing Colorado for user task. 6-13-17: Proceesing US 1yr data for 2011 and 2012. 11-7-2018: Processing 2016 and 2017 1-year data for the US and MO. 12-09-2019: Processing 2018 1-year data for the US and MO. 10-26-2020: Processing 2019 1-year data for the US and MO. 01-18-2022: Processing 2020 1-year data for the US and MO. Note that this year the data uses "experimental weights". See https://www.census.gov/programs-surveys/acs/data/experimental-data/2020-1-year-pums.html 10-20-2022: Processing 2021 1-year data for the US and MO. 11-2-2023: Processing 2022 1-year data for the US and MO. */ %include '/pub/sas/autoexec.sas'; libname acspums '/pub/data/acspums'; libname tempsas '/home/riceg/work/acspums'; %let year = 2022; *<== Change this each year! ; %let yr = %substr(&year, 3, 2); libname dwnlds "/pub/data/acspums/downloads"; options spool compress=binary; * We only get about 25% reduction. Better than nothing. ; x cd /pub/data/acspums/downloads; %macro unzipem(state); * State is KU or a state abbreviation. Period is blank, 3yr, or 5yr ; x unzip -o sas_h&state -d /home/riceg/work/acspums ; x unzip -o sas_p&state -d /home/riceg/work/acspums ; %mend unzipem; %unzipem(us); %unzipem(mo); *-- US --*; data acspums.usprecs&yr(label="&year person data Alabama - Mississippi"); retain vintage "&year" period "1"; set tempsas.psam_pusa; run; data acspums.ushrecs&yr(label="&year housing unit data Alabama - Mississippi"); retain vintage "&year" period "1"; set tempsas.psam_husa; run; proc freq data=acspums.ushrecs&yr; table st; title2 "ushrecs&yr"; run; data acspums.usprecs&yr.b(label="&year person data Missouri - Wyoming"); retain vintage "&year" period "1"; set tempsas.psam_pusb; run; data acspums.ushrecs&yr.b(label="&year housing unit data Missouri - Wyoming"); retain vintage "&year" period "1"; set tempsas.psam_husb; run; proc freq data=acspums.ushrecs&yr.b; table st; title2 "ushrecs&yr.b"; run; *-- MO --*; data acspums.mohrecs&yr.(label="&year persons data for Missouri"); retain vintage "&year" period "1"; set tempsas.psam_h29; * Delete the downloads data set after convert ; run; data acspums.moprecs&yr.(label="&year housing unit data for Missouri"); retain vintage "&year" period "1"; set tempsas.psam_p29; run;