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
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.