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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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