Hi All,
I want to send alert email through sas viya. whenever the saswork libarary is full then automatically it should send an alert mail
Regards,
Shivraj
Check out the SAS Communities library article Tip: How to send email using SAS
Your SAS might not be able to do anything once WORK is exhausted, so this may not work at all.
Instead use your operating system's tools. Servers have tools to detect such conditions and issue alerts in multiple ways.
There are tools at the OS level such as SolarWinds that periodically monitor the work library. Typically, this occurs at 15 minutes interval.
When the free space reduces to a predetermined level (for example 10%), the software sends an alert.
This type of action can be implemented writing a custom script or a SAS program that runs at 15 minutes interval.
In UNIX, I'd run the df command, pipe the output into cut to extract the "percentage used" column, after which mail (or mailx) can be used conditionally. All this in a short shell script which can easily be started every minute through cron (such a script only needs milliseconds to run, with minimal CPU use when no mail needs to be sent).
And it is always a VERY GOOD IDEA to run the SAS cleanwork utility periodically to get rid of the remnants of crashed SAS sessions.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.