BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
AndreaVianello
Obsidian | Level 7

I have a program that prepares a map

 

proc gmap  map=mappaRMV 
           data=tblTOT   all; 
  id pro_com__t; 
 choro percent  / COUTLINE=green levels=5 ;
 format percent 6.2 ;
 run; 

The coloring of the areas is done in shades of blue (Enterprise guide)

 

AndreaVianello_0-1768919685403.png

If I direct the output with ODS PDF and SAS 9.04.01M8  for Windows I get 

AndreaVianello_1-1768919784555.png

 

 

While if I direct the output with ODS PDF and same SAS 9.4 for Linux I get

AndreaVianello_2-1768919935717.png

 

The sas code is EXACTLY THE SAME 


 

Why? Solutions?  

 

1 ACCEPTED SOLUTION

Accepted Solutions
antonbcristina
SAS Super FREQ

Hi @AndreaVianello, SAS uses different styles depending on the destination. For complete control with PROG GMAP, I suggest you create a style yourself to control the colour gradient. Here is an example:

 

/*   DEFINE STYLE   */
%let color1=vligb; /*very light greenish blue  */
%let color2=vigb;  /*vivid greenish blue*/

proc template; 
    define style styles.grad1; 
    parent=styles.listing; 
        style twocolorramp / startcolor=&color1 endcolor=&color2; 
    end; 
run;

You can then use this style in your ODS statements:

 

ods pdf file="..../choro.pdf" style=grad1;
proc gmap  map=toronto data=pop all; 
  id cfsauid; 
  choro pop  / COUTLINE=green levels=5 ;
  format pop 6.2 ;
run; 
ods pdf close;

This is the resulting choropleth map:

antonbcristina_0-1768925432072.png

 

 

 

View solution in original post

5 REPLIES 5
antonbcristina
SAS Super FREQ

Hi @AndreaVianello, SAS uses different styles depending on the destination. For complete control with PROG GMAP, I suggest you create a style yourself to control the colour gradient. Here is an example:

 

/*   DEFINE STYLE   */
%let color1=vligb; /*very light greenish blue  */
%let color2=vigb;  /*vivid greenish blue*/

proc template; 
    define style styles.grad1; 
    parent=styles.listing; 
        style twocolorramp / startcolor=&color1 endcolor=&color2; 
    end; 
run;

You can then use this style in your ODS statements:

 

ods pdf file="..../choro.pdf" style=grad1;
proc gmap  map=toronto data=pop all; 
  id cfsauid; 
  choro pop  / COUTLINE=green levels=5 ;
  format pop 6.2 ;
run; 
ods pdf close;

This is the resulting choropleth map:

antonbcristina_0-1768925432072.png

 

 

 

AndreaVianello
Obsidian | Level 7

Thanks everyone for your help. I was wrong to think the problem was in the proc gmap when it was actually in the ods pdf style.

I also learned how to define a style!

I'll definitely also look into the new features of the proc SGmap .


sbxkoenk
SAS Super FREQ

Hello,

 

Why don't you use PROC SGMAP (instead of proc gmap)?

The prefix SG is for Statistical Graphics.

 

See here:

New SGmap features in SAS 9.4m7
By Robert Allison on Graphically Speaking 
https://blogs.sas.com/content/graphicallyspeaking/2020/09/25/new-sgmap-features-in-sas-9-4m7/

 

Ciao,

Koen

ballardw
Super User

If you like the appearance that EG gives you then the steps are 

1) determine the current ODS STYLE in effect for your session (might be HTMLBlue)

2) on the code that defines the PDF file add the STYLE= option to use the same style. Or if using the EG interface to set the PDF file options there should be a STYLE option somewhere.

Ksharp
Super User
As ballardw suggested, add option STYLE= in your code:

ods pdf file=... style=htmlblue;
proc gmap;
....
run;
ods pdf close;

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1108 views
  • 6 likes
  • 5 in conversation