Thanks everyone. You all have inspired me to the following solution. An SCF is the first 3 digits of a zip code. I needed to get a Latitude/Longitude for an SCF. So I took the first and last coordinates of each zipcode in an SCF, divided by 2 and "close enough for my needs" got the geographical center for an SCF and it's associated Lat/Long. These coordinates are used in SAS VA to create a bubble map of the US. data scf_zip; set sashelp.zipcode(where=(StateCode NOT IN ("PR", "FM", "GU", "MH", "MP", "PW", "VI") AND ZIP_Class = " ")); scf = substr(put(zip,z5.),1,3); keep scf zip x y; run; proc sort data=scf_zip; by scf; run; data scf(rename=(newx=x newy=y)); set scf_zip; by scf; retain x1 y1 0; if first.scf then do; x1 = x; y1 = y; end; if last.scf then do; x2 = x; y2 = y; end; if last.scf then do; newx = sum(x1,x2)/2; newy = sum(y1,y2)/2; output; end; keep scf newx newy; run;
... View more