This macro does not directly process SAS data but interacts with the server's file system for managing a temporary directory. No SAS data sources are read or written by this macro.
1 Code Block
MACRO
Explanation : This block defines the `ClearTEMPWORK` macro. It declares a local variable `rc`. It uses `%sysfunc(fileexist)` to check if the path `c:\tempwork` exists. If the directory exists (`&rc ne 0`), the code attempts to free a potential SAS libname named `tempwork` using `%sysfunc(libname(tempwork))`. Then, it uses `%sysexec` to execute Windows operating system commands: `del /Q "c:\tempwork\*.*"` to silently delete all files and `rd /Q "c:\tempwork"` to silently delete the empty directory. It is crucial to note that this macro is Windows-specific and that the use of `%sysexec` is often disabled or subject to strict restrictions in SAS Viya 4 environments for security and portability reasons.
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.