BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am trying to email the output of proc sql queries and am having problems.
The email settings are correct, the sample from EG Guide Help below results in an email being sent.

Sample from EG Guide

filename outbox email
to='myemail@email.com'
type='text/html'
subject='Temperature Conversions';
data temperatures;
do centigrade = -40 to 100 by 10;
fahrenheit = centigrade*9/5+32;
output;
end;
run;
ods html
body=outbox /* Mail it! */
rs=none;
title 'Centigrade to Fahrenheit Conversion Table';
proc print;
id centigrade;
var fahrenheit;
run;
ods html close;


However when I attempt to replace the proc print with with a proc sql the code hangs and no email is sent. The log seems to indicate that all was good.

Sample Proc SQL

filename outbox email
to='adam.smith@centrebet.com'
TYPE='text/html'
subject='test';
ods html body=outbox rs=none;
title 'Test';
PROC SQL;
SELECT * FROM AA
;
ods html close;
1 REPLY 1
deleted_user
Not applicable
The code hang was resoved by changing the settings in Properties/Results to uncheck the flag "Automatically direct results back to EG "
Dont know why, but it fixed it.

The lack of emails was resolved by checking my junk mail folder 😛

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
  • 1 reply
  • 947 views
  • 0 likes
  • 1 in conversation