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

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!

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.

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