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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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