Hello everyone,
We have a SAS script that runs every day. Most of the time it completes without any problems but randomly it fails with the error:
ERROR: Library WORK does not exist
The WORK library is in fact present and available when we check.
Has anyone experienced this kind of intermittent issue before and could you share ideas on how to investigate the root cause?
Environment details:
SAS 9.4 M6
OS: RedHat Linux
Thanks in advance!
The error message you are seeing is coming from the Red Hat operating system. Please check with RH as to why you are receiving this error message.
An additional question, is your SAS WORK directory on an NFS file system?
Thanks for your reply.
The SAS WORK library is on a local file system dedicated specifically for SAS WORK not on NFS.
Hi @Mahis
Try adding this line at the start of your SAS script
libname _all_ list ;
It will write to the Log all the assigned library references at the time of execution.
Keep in mind, SAS WORK library is typically auto-assigned via specifying its root location in
Check your deployment/execution settings are not negatively affecting where the -WORK is pointing to
Hope this helps
Adding the following two rows at the top of your code.
But that would cost you lots of storage at SAS service side, due to not delete the temporary datasets produced by your sas code.
libname x '.'; options user=x ;
In our case the script starts normally and runs through several steps without issues
The error appears only at the point where it needs to write an output dataset into WORK:
ERROR: Library WORK does not exist.
After that, the job keeps running until the end but whenever it references something that should be in WORK we get messages like:
ERROR: File WORK.TEST1.DATA does not exist.
So it looks like the WORK directory disappears (or becomes inaccessible) while the session is still active
The script itself doesn't stop completely it just keeps failing on any step that needs WORK
This happens randomly maybe 3 times a month while most other days the script finishes without any problem
That seems consistent with a cleanup script that is accidentally removing WORK folders while the SAS process that is using them is still running.
Another thing to check is virus scans (and other scans) of the disk where WORK directories are made that might be temporarily locking access.
Another thing to check is that the algorithm that is being used to generate the name of the directory used for work. It that is accidentally causing two different processes to want to use the same name for the WORK library it might result in the first program having its work directory access removed because the new directory created for the second program is using different permission. Or just plain deleting the files that the first program created.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.