The PATHNAME() function will return the path that a libref or fileref is using.
You can use it in a data step.
data _null_;
length path $256 ;
path=pathname('mylib');
put path= ;
run;
Or wrap it in %SYSFUNC() and use it directly in macro code.
%let path=%sysfunc(pathname(mylib));
You can also ask PROC CONTENTS to tell you where a particular dataset is. That is useful if you libref is actually pointing to multiple directories.
proc contents data=mylib.mymember;
run;
... View more