BookmarkSubscribeRSS Feed
P5C768
Obsidian | Level 7

Is it possible to send PROC GMAP output directly in the body of an Outlook email?  I have done this with other charts/tables and don't see a reason why GMAP would not work, however when I run the code below, it just outputs a table of data from my table, not an actual map.  I'm guessing this might be due to GMAP HTML output needing a .png file as well for SAS 9.2. Any insight is greatly appreciated!  Thanks!

/* Send Email */

option emailhost='localhost';

filename mymail email

    from="me@me.com"

     to=("you@you.com")

     subject="GMAP Output"

  content_type="text/html" ;

ods MSOffice2K

body=mymail style=BarrettsBlue;

proc gmap

  map=mymap

  data=mydata;

  id state;

  choro Group / levels=10  legend=legend1 coutline=black html=my_html;

run;

quit;

ods msoffice2k close;

goptions reset=all;

/* Send Email */

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi: ODS MSOFFICE2K is an HTML based destination. This means that internally to the HTML, any image -- any logo, picture, graph is referenced with an <IMG> tag in the HTML. So when SAS creates output, in the absence of any instructions from you, the PNG image is created in the working directory of your SAS session. When ever you create an HTML file, whether with ODS HTML or ODS MSOFFICE2K, you need to send the HTML file itself and then any external files, like CSS or PNG files that the HTML files is referencing. This is an argument AGAINST using ODS HTML or ODS MSOFFICE2K for email. In fact, many email administrators do not want you to send HTML files in the body of the mail or even as attachments. Or, sometimes they block mail that contains HTML tags.

  It might be better for you to make an RTF or PDF file with ODS (in which the image will be embedded INSIDE the document and will not be a separate image), and then send the RTF or PDF file as an attachment.

cynthia

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 906 views
  • 0 likes
  • 2 in conversation