This script uses system interface functions (SCL functions) encapsulated in %sysfunc to interact with the file system. It assigns a fileref to a folder path, opens it, counts the number of elements, retrieves the name of the last element, and then closes everything properly.
Data Analysis
Type : EXTERNE
The script queries the OS file system. It depends on an external macro-variable '&path' to define the target path.
1 Code Block
MACRO
Explanation : Uses low-level functions (filename, dopen, dnum, dread, dclose) via %sysfunc to manipulate a directory. Displays the number of files and the name of the last file in the log.
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.