Use the BasePlus package and the %dirsAndFiles() macro
e.g.
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result)
It works with UTF characters (I've tested it)
Bart
P.S. Here are some instructions how to get BasePlus package and where the documentation is.
/*
Details about SAS Packages Framework:
- https://github.com/yabwon/SAS_PACKAGES
Tutorial:
- https://github.com/yabwon/HoW-SASPackages
BasePlus documentation:
- https://github.com/SASPAC/macroarray/blob/main/baseplus.md
*/
/* Step 1. */
/* Install SAS Packages Framework and BasePlus package. */
/* Run this only once. */
filename SPFinit url "https://bit.ly/SPFinit";
%include SPFinit;
filename SPFinit clear;
/* create directory for the framework and packages */
filename packages "</your/directory/for/packages/>";
/* install the framework and the BasePlus package */
%installPackage(SPFinit BasePlus)
/* Step 2. */
/* From now on if you want to use a package: */
/* Run this at the beginning of your new SAS Session (or add it to autoexec). */
/* Enable framework and load package */
filename packages "</your/directory/for/packages/>";
%include packages(SPFinit.sas);
%loadPackage(BasePlus)
The link it to the macro documentation. Check the "P.S." to see how to get the BasePlus package which contains the %dirsAndFiles() macro.
Bart
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.