Hi, I have two files. One file contains LocationID and associated latitude and longitude for each LocationID. Another file is Census Tiger file (tabblock10.shp) in Shapefile format. File tabblock10 contains blockID and associated latitudes and longitudes (polygon which defines the block). I want to match these two files to determine the blockID for each LocationID (find block each location falls into based on the shape file). How to do such a spatial join in SAS? Thanks.
This procedure does the trick I believe
SAS Help Center: Syntax: PROC GINSIDE PROC GINSIDE Statement
You must import the shapefile using the appropriate shape importer,
Please provide sample data and your desired result. Makes it much easier to provide a usable code answer.
This procedure does the trick I believe
SAS Help Center: Syntax: PROC GINSIDE PROC GINSIDE Statement
You must import the shapefile using the appropriate shape importer,
Here's an example.
The GINSIDE procedure is used to find out if the location (customer) is inside or outside the polygon.
Example 2: Mapping and Annotating Values from the GINSIDE Procedure
(Example 1 might be simpler.)
The above page has extensive info on the how and why of each individual statement in the program.
To import your TIGER file: go to
and search for TIGER in the search field (click on magnifying glass).
Cheers,
Koen
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.