BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Okay, the problem is that I have to send an e-mail with a subject line and a message in the body. But when I run my job it sends two e-mails and I only want one. Here's my JCL:
FILENAME OUTBOX EMAIL
TO=('person@msn.com')
SUBJECT='email test'
CT='TEXT/HTML';
*----------------------------;
DATA _NULL_;
FILE OUTBOX;
PUT '!EM_SUBJECT! email test';
PUT 'message in the body of email';
*----------------------------;
ODS HTML BODY=OUTBOX
STYLE=MINIMAL
RS=NONE;
ODS HTML CLOSE;
/*
I've tried it using the e-mail address on the filename statement, and using the PUT statement is the only way I know to put a message in the body of the e-mail. But when I do this it produces two e-mails. So what can I do to only send one e-mail that will have both a subject and a body?
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Refer to the SAS 9.2 DOC on this topic - link below. Also, there are several similar topic-related technical papers and SAS supplemental tips technotes on the SAS support website http://support.sas.com/ for your reference.

Also, be aware that are known SAS 9.1.3 SP1 problems where multiple EMAILs are generated, one that is blank and a second that has the desired output, but only when using ODS LISTING, as I recall.

Scott Barry
SBBWorks, Inc.

http://support.sas.com/documentation/cdl/en/lrdict/59540/HTML/default/a002058232.htm

http://support.sas.com/documentation/cdl/en/hosto390/59577/HTML/default/chfnoptfmain.htm
deleted_user
Not applicable
Thanks.
I wasn't getting any blank e-mails, but you did give me the idea of removing the ODS part of my JCL and when I did that, It only sent one e-mail. So thanks again.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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