Search the site...

SASCRUNCH TRAINING
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
Sentry Page Protection
Please Wait...
Geo-targeting Project [20-25]


We will now generate the list of postcodes that are within 4.5 km of the three stores that we selected.

​The code below finds all the postcodes that are within 4.5 km of the stores:​
proc sql;
create table target_postcode as
select a.*,
       round(((b.os_x - a.os_x)**2 + (b.os_y - a.os_y)**2) **0.5, 1) as dist
from all_postcode a, locations b
where b.postcode in
  (select store_postcode
   from target) and 
calculated dist <= 4500;
quit;
Did the code fail?

Copy and run the code below to create the input data sets.

There are 42408 postcodes that fall within the range of 4.5 km from the selected stores:
Picture
Next
Already a member? Go to member's area.