BookmarkSubscribeRSS Feed
jerry898969
Pyrite | Level 9

Hello, I have a process that will send me an email if there are errors found in a log file.  It has been working fine until the other day when I didn't receive the email.  When I checked the data was incorrect but I didn't get to see the log because the file overwrites itself.  The issue that the email didn't go out is that the length of the message was really large.


I'm using code similar to this code:


options emailsys=smtp emailhost=test.smtp.com emailport=89;

filename mymail email "test@test.com" subject="TEST ERROR";


data _null_ ;

set DataDump ;

file mymail ;

put ErrorText ;

run ;


I want to put checks in so the message will not exceed this size so I can still see that there are issues and check the log right away.  Thank you.

2 REPLIES 2
jwillis
Quartz | Level 8

Jerry,

My solution has been to write the log to a dataset (proc printto) and attach the file to the email.  In your data _null_ step; can you strip/substr/etc..  ErrorText text into smaller sizes (100 characters) then put the smaller sizes?  For example, I would write DataDump to a file and then attach the file to my email.

jerry898969
Pyrite | Level 9

jwillis, Thank you so much.  That is a great idea.  I will try that out.  Another thing I was going to try was to limit the number of rows to 100 and at least that would tell me something is wrong and I can get an idea of what the situation is. Thank you

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1430 views
  • 4 likes
  • 2 in conversation