Using PATHNAME to Retrieve a Physical Path


/ Published in: SAS
Save to your folder(s)

If you know a libref or fileref, the PATHNAME function can be used to return the physical location.

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:


Copy this code and paste it in your HTML
  1. /*Single file reference*/
  2. libname sasclass 'c:\training\basics';
  3. %let loc = %sysfunc(pathname(sasclass));
  4.  
  5.  
  6. /*Multiple files reference*/
  7. %put %sysfunc(pathname(sashelp));
  8. /*
  9. ( 'C:\Program Files\SAS\SAS 9.1\nls\en\SASCFG' 'C:\Program Files\SAS\SAS 9.1\core\sashelp'
  10. 'C:\Program Files\SAS\SAS 9.1\af\sashelp' 'C:\Program Files\SAS\SAS 9.1\assist\sashelp'
  11. 'C:\Program Files\SAS\SAS 9.1\connect\sashelp' 'C:\Program Files\SAS\SAS 9.1\eis\sashelp'
  12. 'C:\Program Files\SAS\SAS 9.1\ets\sashelp' 'C:\Program Files\SAS\SAS 9.1\graph\sashelp'
  13. 'C:\Program Files\SAS\SAS 9.1\iml\sashelp' 'C:\Program Files\SAS\SAS 9.1\insight\sashelp'
  14. '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' )
  15. */

URL: http://www.sascommunity.org/wiki/Tip_of_the_Day:July_11

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.