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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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