This blog post describes a neat example of some cool SAS capabilities, and also teaches you a little more about the state where SAS software is made...

Here at the SAS headquarters in Cary, NC, the main TV news channel is WRAL TV5. And my favorite segment during the news is Scott Mason's Tar Heel Traveler - he goes around the state doing stories that show a lot of heritage, tradition, and generally interesting things about North Carolina.

The WRAL site has a list of all the stories by month (here's a screen-capture of a portion of the list)...

But I wanted to be able to search for stories geographically. For example, if I was going to the Outer Banks, I thought it would be neat to view all the stories from that area before my trip.

Therefore I used SAS software to create an interactive map-based interface to all the stories (click the snapshot below, to see the interactive map). I invite you to try out this map, and randomly view a few of the stories ... but I'll warn you ahead of time that it can be addicting! You'll learn some interesting things about the state where SAS software is made (in the stories), as well as see some cool capabilities of SAS software (by trying out the interface).

And now for the important question ... did you find any 'interesting' Tar Heel Traveler stories? (feel free to mention which story is your favorite, in a comment!)

Technical Details:

The main portion of this interface is a map created with Proc Gmap, and then circular (pie) markers annotated on the map. To determine the location of the markers, I took the name of the city mentioned in each story, looked up the zip code for each city, and then used Proc Geocode to determine the latitude & longitude of the cities. I also used annotate to draw a line from each city to Raleigh (where WRAL is headquartered).

When you hover your mouse over the markers on the map, you see the title of the story from that city. If a city has 1 story, I add an html drill down link to the URL for that story. But if the city has more than one story, I have the html drill down go to a list of the stories for that city (using the city name as the 'anchor' in the URL), and then the story names in the list are encoded with URL links to take you to the actual stories. I used a 'data step' with 'put' statements so I could create the table exactly like I wanted, with the html anchors a lot of blank lines between each city (so that when you drill down a city, you only see the lines for that one city).

After several years, the map was getting a bit crowded with so many stories, therefore I decided to also create a separate map for each year - this makes it easier to see "what are the latest stories I might not have seen yet?" I annotated year numbers along the right-side of the main map, and set up html drill down links on each year. Now you can click a year to see just that year's stories (for example '2013')...

And a few extra features illustrated in this example ... The iback goption was used to place the blue background image behind the map. The Tar Heel Traveler logo was placed in the bottom/left of the map using the annotate image function. And the 'shadow' effect was placed behind the map using an annotated polygon. This example shows many useful SAS capabilities you might not have seen before. I invite you to download the SAS code if you want to see exactly how to code a map-based interface like this!