SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Akhila1
Fluorite | Level 6

I wish to know the school district for a given home address of a student. 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Census Bureau is better it seems, single file:

https://nces.ed.gov/programs/edge/Geographic/DistrictBoundaries

 

  1. Use PROC GEOCODE to map your addresses to lat/long
  2. Use PROC MAPIMPORT to import the boundary file
  3. Use PROC GINSIDE to determine which points from #1 belong to which regions in #2

 

If you have something like QGIS or ESRI ARCGIS this is more easily accomplished in those tools via point and click procedures except for Step #1. 

 

 

View solution in original post

6 REPLIES 6
ChrisHemedinger
Community Manager

You may be able to use SAS geocoding functions to convert an address to some other geo field (like a zip code or other region or lat/long), but you're going to need a database of school districts and their boundaries. Or sometimes the rules are more complex, and you need to use a web service (if available) to perform this lookup.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
Reeza
Super User

You'll need to provide more details. 

 

Do you have a data set of school districts of some kind? Maps of those spatial area's in SHP files?

What country are you in?

Akhila1
Fluorite | Level 6
I am in USA. I do not have a data set of school districts.
Reeza
Super User

Are you looking at all of USA or a particular state or region?
States/ municipalities often publish this data on their open data portal. 

Example: https://catalog.data.gov/dataset/tiger-line-shapefile-2017-state-california-current-secondary-school...

 

 

Reeza
Super User

Census Bureau is better it seems, single file:

https://nces.ed.gov/programs/edge/Geographic/DistrictBoundaries

 

  1. Use PROC GEOCODE to map your addresses to lat/long
  2. Use PROC MAPIMPORT to import the boundary file
  3. Use PROC GINSIDE to determine which points from #1 belong to which regions in #2

 

If you have something like QGIS or ESRI ARCGIS this is more easily accomplished in those tools via point and click procedures except for Step #1. 

 

 

ballardw
Super User

A possible issue may be that your school does not actually belong to a school district. School Districts typically are Public schools and do not consider a Private school in there geography as belonging to the district.

 

I have worked with public/ private mixed school data. If this is for a single state I might also search the department of education, or whatever a specific state might call it, website. I know in my state I can get such information along with enrollment and other bits in a single file.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1708 views
  • 6 likes
  • 4 in conversation