Tip of the Day:March 21

From sasCommunity
Jump to: navigation, search

sasCommunity Tip of the Day

If you know a libref or fileref, the PATHNAME function can be used to return the physical location. In the following %LET statement the path for the libref SASCLASS will be stored in the macro variable &LOC.

libname sasclass 'c:\training\basics';
%let loc = %sysfunc(pathname(sasclass)); 

If the libref refers to more than one physical location, all of those locations will be returned, in quotes, separated by spaces, with the whole list in parentheses:

1    %put %sysfunc(pathname(sashelp));
( 'C:\Program Files\SAS\SAS 9.1\nls\en\SASCFG' 'C:\Program Files\SAS\SAS 9.1\core\sashelp'
'C:\Program Files\SAS\SAS 9.1\af\sashelp' 'C:\Program Files\SAS\SAS 9.1\assist\sashelp'
'C:\Program Files\SAS\SAS 9.1\connect\sashelp' 'C:\Program Files\SAS\SAS 9.1\eis\sashelp'
'C:\Program Files\SAS\SAS 9.1\ets\sashelp' 'C:\Program Files\SAS\SAS 9.1\graph\sashelp'
'C:\Program Files\SAS\SAS 9.1\iml\sashelp' 'C:\Program Files\SAS\SAS 9.1\insight\sashelp'
'C:\Program Files\SAS\SAS 9.1\lab\sashelp' 'C:\Program Files\SAS\SAS 9.1\or\sashelp' 'C:\Program
Files\SAS\SAS 9.1\qc\sashelp' 'C:\Program Files\SAS\SAS 9.1\stat\sashelp' 'C:\Program
Files\SAS\SAS 9.1\tmine\sashelp' )

Submitted by Art Carpenter. Contact me at my Discussion Page.

Feel free to comment on this tip.

Prior tip - Next tip - Random Tip

Submit a Tip