BookmarkSubscribeRSS Feed
nbasnet
Fluorite | Level 6

How do I create a html anchor ? I have a map on the top and a table on the bottom. The map is a ZIP code level map which contains hospital visit rate and the table below contains the same ZIP code and the visit rate. Is there a way of anchoring the map with the content of the table and not the table? I mean when I click on a x ZIP code on map, it should anchor with x ZIP code on the table too. Also does the variable has to be same? The PROC GMAP uses numeric variables for data=option and the PROC REPORT uses character variables for data=option.

1 REPLY 1
GraphGuy
Meteorite | Level 14

Here's the simple case for html anchors ... When you're creating "ods html" output, you can insert an html anchor before any proc by using a line of code like this right before the proc you want to have the anchor to:

 

ods html anchor="witch";

Then you can go to the anchors using urls like:

 

http://robslink.com/SAS/democd82/halloween_polygons.htm#witch

http://robslink.com/SAS/democd82/halloween_polygons.htm#cat

 

 

I'm not 100% sure about your question, but it sounds like you want to click zip codes in your map, and have it drill/scroll to that specific row in a table(?) That's a little trickier, and you have to embed the html anchor tags as invisible/non-printing code in the table. Here's an example I have, which does that sort of thing...

 

In this map, if you click on a county that has blue dots, then you will drill/scroll to the beginning of that county's data in the table below (via an html anchor). Be sure to click on the county, not the blue dots (the blue dots have a different drilldown).

 

http://robslink.com/SAS/democd80/nc_business_incentives_map.htm

 

For example, if you click on 'Raldolph' county, it will go to the following url+anchor (which should put you on the first line of Raldolph county's data in the table)...

 

http://robslink.com/SAS/democd80/nc_business_incentives_map.htm#Randolph

 

 

Here's the full SAS code used to create the above example:

http://robslink.com/SAS/democd80/nc_business_incentives_map.sas

 

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 832 views
  • 0 likes
  • 2 in conversation