Features: |
ZIP geocoding method
|
Other features: |
|
Data set: | lookup.GBpostcodes (Postcode lookup data from MapsOnline) |
Sample library member: | GEOZIPUK |
data offices; infile datalines dlm=','; length name city $24 postcode $8 country $2; input name /* Office name */ city /* Name of city */ postcode /* Royal Mail postcode */ country; /* Two-character country ID */ postcode=upcase(compress(postcode)); /* Normalize postcodes */ datalines; Quay Plaza, Manchester, M50 3BA, UK Wittington House, Buckinghamshire, SL7 2EB, UK Tara House, Glasgow, G2 1HG, UK New Broad Street, London, EC2M 1NH, UK ; run;
proc geocode /* Invoke geocoding procedure */ method=zip /* Specify geocoding method */ data=work.offices /* Input data set of offices */ out=geocoded_offices /* Output data set of locations */ lookup=lookup.GBpostcodes /* Postcode lookup data from MapsOnline */ addresszipvar=postcode /* Postcode variable in input data */ lookupzipvar=pc /* Postcode variable in lookup data */ lookuplongvar=Lon_WGS84_DD /* Longitude variable in lookup data */ lookuplatvar=Lat_WGS84_DD /* Latitude variable in lookup data */ attributevar=(lat_wgs84_dms /* Additional variables from lookup data */ lon_wgs84_dms); /* set to assign to geocoded locations */ run;