BookmarkSubscribeRSS Feed
cjohnson
Obsidian | Level 7
I am experimenting with email and ODS. I have a program that works, but after I receive the email with the correct data, the SAS process never ends. Is there something I need to add to end it?

FILENAME MAIL EMAIL
SUBJECT = "ODS Test."
FROM = "test@bsi.com"
TO = "test@bsi.com"
TYPE = "text/html";

ODS HTML BODY=MAIL;

PROC SQL;
SELECT DATEPART(MAX(TRANS_DATE)) FORMAT=MMDDYY8. AS TIER
FROM PRODTIER.TIER_POLICY_REPORTS;
QUIT;

ODS HTML CLOSE;
Christopher Johnson
www.codeitmagazine.com
5 REPLIES 5
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Add the following statement to your SAS program:

FILENAME MAIL CLEAR;


Scott Barry
SBBWorks, Inc.
cjohnson
Obsidian | Level 7
Thanks for replying so quickly. I added this to the end of the program, but the process still does not end. The task status still says "Running PROC SQL"

Thanks
Christopher Johnson
www.codeitmagazine.com
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Maybe the SAS program is still executing? You will want to try some tests with setting OBS=100 or something to abbreviate the processing.

Scott Barry
SBBWorks, Inc.
cjohnson
Obsidian | Level 7
I tried replacing the proc sql with:
data _null_; run;
but the process still doesn't end. I also closed the SAS session, reopened, and tried again. Any suggestions?

Thanks again.
Christopher Johnson
www.codeitmagazine.com
cjohnson
Obsidian | Level 7
I don't understand it, but I got it. I moved the TO line in the Filename statement as follows:
FILENAME MAIL EMAIL "test@bsi.com"
SUBJECT = "RBU & TIERING LOADS."
FROM = "test@bsi.com"
TYPE = "text/html";
Now it works fine.
Thanks again.
Christopher Johnson
www.codeitmagazine.com
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
  • 5 replies
  • 1925 views
  • 0 likes
  • 2 in conversation