We will now map the full list of England's postcodes back to the SALES_Q1_LOC_POS table:
Did the code fail?
Copy and run the code below to create the input data sets.
proc import datafile = "/folders/myfolders/Geo-targeting/Data Files/locations.csv"
out = locations
dbms = CSV
proc import datafile = "/folders/myfolders/Geo-targeting/Data Files/postcode.csv"
out = postcode
dbms = CSV
create table sales_q1_loc as
select a.*, b.os_x as store_x, b.os_y as store_y
from sales_q1 a, locations b
where a.store_postcode = b.postcode;
create table sales_q1_loc_pos as
select a.*, b.os_x as cust_x, b.os_y as cust_y
from sales_q1_loc a left join postcode b
on a.customer_postcode = b.postcode;
filename postcode '/folders/myfolders/Geo-targeting/Data Files/open_postcode_geo.csv';
data all_postcode (keep=postcode os_x os_y);
infile postcode dsd firstobs=2;
input postcode : $8.
col1 : $10.
col2 : $5.
area : $8.;
if area = "England" and os_x^=.;
The Proc SQL step above adds two additional columns to the table:
Username or Email Address
Registration confirmation will be emailed to you.