I have an excel dataset that includes city and state that are global. I'd like to have a global map that has a red dot for each of the cities that are listed. I don't need anything regarding density or populations, etc. just a single dot.
I'm new to graphics and mapping in SAS. What's a good resource to start? I've found ways to add lat & long, seems pretty simple, but I'm missing the graphing part of it.
Thank you!
Assuming you're using the newest version of SAS or SAS UE try SGMAP.
Otherwise, try GMAP procedure.
Each proc has examples you can run in the documentation.
You mention "city and state" which kind of implies United States (or countries that have states), but you also mention "global" which implies countries all over the world (which might not have 'states' per say). Could you be a little more specific on which of those it is? (and if the cities are worldwide, exactly what other information do you have that can narrow down which city. City names are pretty much unique in most US states ... but perhaps not in other countries.
Step 1 will be to get the lat/long for each city. Perhaps using Proc Geocode, or perhaps merging in the values from one of the various datasets in mapsgfk.world_cities or mapsgfk.uscity, etc.
Step 2 will be to plot the lat/long as dots on a map. You could use Proc SGmap with a scatter plot overlaid (if you have the latest version of SAS - v9.4 maintenance 6), or you could use Proc GMap with the dots annotated (if you have SAS/Graph).
There are easily a dozen variations of how to do it, but we'll be able to point you in a specific direction once we know more details...
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.