x cd /pub/data/georef/Tools; %let pgm=zcta_cd; filename pgm "&pgm..sas"; *--Look at output from M/G12 run to relate ZCTAs to CDs (113th). What portion of the pop could be assigned to a CD accurately based on ZIP code?---; filename in "/SAS_temp/14APR0751422.geocorr12/geocorr12.csv"; *<===obviously, just temporary==; data clist; infile in dsd firstobs=3; length ZCTA $5 CD $2 _zipname $64 pop afact 8; input ZCTA--afact; run; proc sort; by zcta cd descending pop; run; data ; set clist end=last; by zcta cd; if first.zcta then InPrimary+pop; if first.cd and afact=1 then do; nzip1cd+1; pop1cd+pop; end; Totpop+pop; if last then do; pctPrimary=100*InPrimary/totpop; pct1popcd=100*pop1cd/totpop; format pct: afact 5.1; put _all_; end; run;