## Data visualization with SAS programming

Solved
Contributor
Posts: 39

Hi,

I am trying to draw 10 mile radius circles around my locations on a map. Does someone know how to do this?

Here is my code:

/**FOR A COUNTIES MAP THE X AND Y COORDANIATES NEED TO BE CHANGED SO THIS IS DONE HERE**/ DATA P1; SET P1(WHERE=(STATE=34));   X=ATAN(1)/45 * LONG;   Y=ATAN(1)/45 * LAT; RUN; /**MAKE STAR MARKER OR ANOTHER TYPE OF MARKER**/ DATA P;/*ANNOTATE DATA SET*/ SET P1;/*PROVIDER DATA WITH X/Y*/ LENGTH FUNCTION STYLE COLOR \$ 8 TEXT \$4; XSYS = '2'; YSYS = '2';  HSYS = '3'; WHEN = 'A';  /**MAKE STAR MARKER OR ANOTHER TYPE OF MARKER**/ FUNCTION='LABEL'; STYLE='MARKER'; TEXT='V' SIZE = 1.75; IF PILOT='P' THEN COLOR='BILG';/**GREEN**/ IF PILOT='E' THEN COLOR='ORANGE';/**ORANGE**/ IF PILOT='A' THEN COLOR='CXFF0000';/**RED**/ IF COUNT=1 THEN POSITION='5'; IF COUNT=2 THEN POSITION='A'; IF COUNT=3 THEN POSITION='F'; OUTPUT; RUN;

Thanks.

Accepted Solutions
Solution
‎11-14-2014 01:07 PM
SAS Employee
Posts: 990

## Re: Help Drawing Radius Circles

That's in Example 24 in my book "SAS/Graph: Beyond the Basics".

Here's the sas code, and sample output...

Public Radio Stations in NC (SAS/Graph gmap)

All Replies
Solution
‎11-14-2014 01:07 PM
SAS Employee
Posts: 990

## Re: Help Drawing Radius Circles

That's in Example 24 in my book "SAS/Graph: Beyond the Basics".

Here's the sas code, and sample output...

Public Radio Stations in NC (SAS/Graph gmap)

Contributor
Posts: 39

## Re: Help Drawing Radius Circles

Quick question...when using levels for the CHORO option is there a way to tell the bottom level to use zero?

Thanks.

SAS Employee
Posts: 990

## Re: Help Drawing Radius Circles

I don't think there's an option to force the legend levels to start at zero, but you could probably insert a 'fake' item into your data (that doesn't match any real map areas), and give it a value of zero.

But when I care about the legend ranges (or 'buckets' as they are sometimes called), I usually take full control, and create a new variable, and then a user-defined format to make the text in the legend show up the way I want, such as ...

proc format;

value winefmt

1 = '0 to .2'

2 = '.2 to .3'

3 = '.3 to .4'

4 = '.4 to .5'

5 = 'over .5'

;

run;

data my_data (drop=all decile); set my_data (where=(state_name^='District of Columbia'));

format wine_bucket winefmt.;

if wine<=.2 then wine_bucket=1;

else if wine<=.3 then wine_bucket=2;

else if wine<=.4 then wine_bucket=3;

else if wine<=.5 then wine_bucket=4;

else wine_bucket=5;

run;

🔒 This topic is solved and locked.