Anyone knows if there is a local solution to replace "ESRIMAP" step in the code below? I searched how to map on SAS, but my data platform doesn't allow me use any internet. So this example leads to a picture with gradient only but no map.
proc sgmap mapdata=states
maprespdata=sashelp.us_data
plotdata=plot_data;
esrimap
url='https://services.arcgisonline.com/arcgis/rest/services/Canvas/
World_Light_Gray_Base/MapServer';
choromap population_2020 / mapid=state density=2
name='choro';
text x=long y=lat text=statename /
textattrs=(size=6pt);
gradlegend 'choro' / title='2020 Population'
extractscale;
run;
ods graphics / reset;
title;
Thank you!
If you can't use ESRI, you would need to somehow upload a shapefile (in this case, a US state shapefile) to whatever the location is where your data are. I don't think base SAS has any 'built-in' shapefiles in sashelp, but I could be wrong.
Generally, these files are actually a set of files (.shp, .shx, etc.) - you'd upload them all to one folder, then use PROC MAPIMPORT to convert these into a SAS dataset (by pointing it at the .shp file). There are various other procedures you can use to manipulate that file afterwards (GREDUCE, GRPOJECT, etc.) depending on your needs, after which you'd use SGMAP or GMAP to create the map (along with your dataset that contains the values to be plotted).
If you can't use ESRI, you would need to somehow upload a shapefile (in this case, a US state shapefile) to whatever the location is where your data are. I don't think base SAS has any 'built-in' shapefiles in sashelp, but I could be wrong.
Generally, these files are actually a set of files (.shp, .shx, etc.) - you'd upload them all to one folder, then use PROC MAPIMPORT to convert these into a SAS dataset (by pointing it at the .shp file). There are various other procedures you can use to manipulate that file afterwards (GREDUCE, GRPOJECT, etc.) depending on your needs, after which you'd use SGMAP or GMAP to create the map (along with your dataset that contains the values to be plotted).
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.