1. By default, SAS will store output in the current working directory. SAS Studio runs initialization code that changes the current working directory to the WORK path to ensure it is writable. In code that generates output to a file, you can typically define where to send it.
2. When an individual SAS session terminates gracefully, it will remove it's WORK path. If the SAS session ends in such a way that this cannot be done, the WORK location remains and must be cleaned up manually.
3. No, this would need to be done outside of Viya.
4. In the WORK path typically you'd have a directory for each compute session and within that a WORK directory, a UTILLOC directory, and any output files. These would each be owned by the user who owns that compute session and only writable by them, so any cleanup activity would need to be done as root.
By default, WORK is set to an emptyDir volume which is a temporary volume tied to the pod, so regardless of how the pod ends it would be removed, however this can be undesirable because it uses the node's local storage so could risk bringing down the node if no node-level disk quota is in place.
The transformer I mentioned allows you to change WORK to use any Kubernetes volume definition, so this could be a local path on the nodes (which would be lost if the node was reprovisioned by the cloud provider, and could be a different storage device than the root), an NFS share or permanent PVC (where no automated cleanup would occur), or a generic ephemeral volume (a PVC that gets deleted when the pod is removed).
--
Greg Wootton | Principal Systems Technical Support Engineer