Hi,
Is there is any way to read directory path from the file reference?
for e.g. I had file references declared in one stage of a program as: filename fref <dir>;
In other place I want to get the directory path <dir> only by using fref.
Please let me know how this can be done.
your help is much appreciated.
-Sudharsanan
Hi,
You want:
data _null_;
put %sysfunc(pathname( **your file refence** ));
run;
So the %sysfunc(pathname()) will return the address.
You seem to have mixed macro and data step logic there.
In a data step you can call the PATHNAME() function directly.
data _null_;
path = pathname('sashelp');
put path=;
run;
In macro code you can call the PATHNAME() function using %SYSFUNC().
%put path=%sysfunc(pathname(sashelp));
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.