The SAS Output Delivery System and reporting techniques

Ending Procedure

Reply
Frequent Contributor
Posts: 97

Ending Procedure

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Ending Procedure

Add the following statement to your SAS program:

FILENAME MAIL CLEAR;


Scott Barry
SBBWorks, Inc.
Frequent Contributor
Posts: 97

Re: Ending Procedure

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Ending Procedure

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.
Frequent Contributor
Posts: 97

Re: Ending Procedure

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
Frequent Contributor
Posts: 97

Re: Ending Procedure

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
Ask a Question
Discussion stats
  • 5 replies
  • 170 views
  • 0 likes
  • 2 in conversation