x cd /pub/data/georef/Tools; %let pgm=beale03; filename pgm "&pgm..sas"; *--create data sets with 2003 Beale Urban-Rural continuum codes. As download from USDA web site by Tracy May, 2006. jgb, May, 2006. Rerun 3-07 to make the Beale code variables character instead of numeric. --*; filename text '/pub/sasmacro/Sbeale03_.sas'; filename in '../RuralUrbanCodes2003.csv'; libname georef '/pub/data/georef'; data georef.usbeale03(label='Beale Urban Rural Continuum codes revised 2003' drop=_beale03desc) bealecds(keep=beale03 _beale03desc); infile in dsd termstr=crlf firstobs=2; length fipco County $5 State $2 Stab $2 _cntyname $32 Beale93 Beale03 $1 pop2k PctWrkers 4 _beale03desc $96; informat pop2k comma.; input fipco stab--_beale03desc; County=fipco; format County $county.; State=substr(fipco,1,2); _beale03desc=tranwrd(_beale03desc,'population','pop'); _beale03desc=tranwrd(_beale03desc,' or more','+'); drop _cntyname; label PctWrkers="% of workers in nonmetro counties commuting to central counties of adjacent metro areas"; label beale03='2003 Rural-urban continuum code'; format pop2k comma9.; run; proc sql; create table bcodes as select distinct beale03, _beale03desc from bealecds ; quit; %genfmat(setin=bcodes,argvars=beale03,labelvar=_beale03desc,labellen=120,arglen=1, fmatname=beale03_,runproc=1); data georef.bealecds03(label='Beale Rural-Urban Continuum codes as of 2003'); set bcodes; rename _beale03desc=Meaning_of_code; run; proc print data=georef.bealecds03; title2 "&syslast"; run; data georef.mobeale03(label='MO subset of usbeale03'); set georef.usbeale03; where state='29'; run; proc print data=&syslast; title2 "&syslast"; run;