BookmarkSubscribeRSS Feed
Yennie
Calcite | Level 5
Hi All,

I have just created a HTML page call Test.Htm which contains four line graphs.

I am using SAS to automate an email with the html page attached to it and send it to my manager monthly. So that when he opens up the email, it will just show the content of the html (showing all the graphs). This is my script so far...

FILENAME Finnote EMAIL TO = "ABC@Edgecorp.com.au"
SUBJECT = "Monthly Sales Report & Graphs";
DATA _NULL_;
FILE Finnote;
PUT '???????????? ';
PUT '????????????? ';
RUN;

I undestand that this will only automate the email however, it does not attach the webpage on the email.

Hoping someone can help out ! 😞

Cheers
Yennie
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
If you search support.sas.com using the string
ODS HTML email
you will come up with a lot of hits. This is just one of them:
http://support.sas.com/kb/6/735.html

For what you're doing (HTML page with graphs), you will probably want to use the second method and use ATTACH=
for the HTML page (and remember that if you have created the type of HTML page with <IMG> tags you'll also need to attach the image files).

I do recommend that you search on support.sas.com, as there are some configuration options that you may need to have your SAS administrator set so you can use the EMAIL method.

cynthia
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Personally have been unsuccessful with packaging an EMAIL with attachments, containing a combination of related "files" (HTML, GIF or other image files) that comprise a "webpage". It's definitely possible, but the recipient must first save all of the attachments to a file-directory location, and then launch the primary "index" page. An example would be one where there is a combination of SAS-generated FRAME/CONTENTS HTML documents and also graphic-image files to render as part of the "webpage".

A better approach I found was to generate the web-publishing content to a web-server location, and then send an EMAIL with an imbedded link to the prmary page.


Scott Barry
SBBWorks, Inc.
Cynthia_sas
SAS Super FREQ
Hi:
I agree. It is sort of a pain to try to keep all the files together. One solution in SAS 9.2 is to use ODS PACKAGE destination to make a zip archive of all the files you need for a job and then to email the zip archive as the attachment. Of course, you have to be able to send and your recepients need to be able to receive zip files, but that is an alternative.

There's some 9.2 code below to test. You would then use the .ZIP file name with the ATTACH= option for EMAIL and all the files created for ODS HTML -- the main file and all the image files will be together.

cynthia
[pre]

ods listing close;
ods package open;
ods html package file="allstuff.html" style=analysis;

*** proc gchart or other SAS/GRAPH proc;

ods html close;
ods package publish archive properties(archive_name="allstuff.zip" archive_path="./");
ods package close clear;
ods _all_ close;
** If you have SAS Package Reader installed ;
** you can name the file with the .SPK extension.;


[/pre]
Yennie
Calcite | Level 5
Hi Cynthia,

Thanks heaps for your help. It worked 🙂 Just if anyone need this piece of code... I got something like that :

/********** Email To ***********************/
Filename Test Email To = 'ABC@mail.com' Type='Text/html'
Subject = 'Report';
/***** Your html page starts here which will be view by the receipients *****/
ODS Markup Body = Test Style = SASWEB;
Title 'This is my title on my html';
PUT 'Hello Good Day;
ODS Markup CLOSE;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 934 views
  • 0 likes
  • 3 in conversation