Sample 42654: Return a list of the SASAUTOS locations
This sample list the locations in order from left to right that are
contained within the SASAUTOS option.
The following is listed in the log:
1.) The position the fileref or path appears in the SASAUTOS option
2.) The fileref (full path is listed if no fileref is set up)
3.) The actual path and or paths the fileref points to
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
%macro listautos;
%local autoref i ref refpath;
/** Retrieve the value of the SASAUTOS option **/
%let autoref = %qsysfunc(getoption(sasautos));
%let i=0;
%do %until(&ref eq);
/** Pull off the first item contained within SASAUTOS **/
%let ref = %qscan(&autoref,&i+1,%str(() ,));
/** If everything has been read or if empty leave the macro **/
%if &ref eq %then %return;
/** Check to see if the item returned contains quotes **/
/** If it does not precede to the next %LET statement **/
%if %sysfunc(indexc(&ref,%str(%'),%str(%"))) eq 0 %then %do;
/** Return the path the fileref points to **/
%let refpath=%qsysfunc(pathname(&ref));
%let i = %eval(&i + 1);
/** Print location fileref path **/
%put &i &ref &refpath;
%end;
/** We hit this %ELSE if the item contains quotes, not a fileref **/
%else %do;
%let i = %eval(&i + 1);
/** Print location path **/
%put &i &ref;
%end;
%end;
%mend listautos;
%listautos
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Results in the log:
1 sasautos ('C:\Program
Files\SAS\SASFoundation\9.2\core\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\accelmva\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\cstframework\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\dquality\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\hpf\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\access\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\assist\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\eis\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\ets\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\genetics\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\gis\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\graph\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\iml\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\or\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\qc\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\share\sasmacro' 'C:\Program
Files\SAS\SASFoundation\9.2\stat\sasmacro')
This sample will return a list of the locations specified within the SASAUTOS option.
Date Modified: | 2011-03-17 11:00:14 |
Date Created: | 2011-03-10 12:55:55 |
Operating System and Release Information
SAS System | Base SAS | z/OS | | |
Z64 | | |
OpenVMS VAX | | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
Microsoft Windows XP 64-bit Edition | | |
Microsoft® Windows® for x64 | | |
OS/2 | | |
Microsoft Windows 95/98 | | |
Microsoft Windows 2000 Advanced Server | | |
Microsoft Windows 2000 Datacenter Server | | |
Microsoft Windows 2000 Server | | |
Microsoft Windows 2000 Professional | | |
Microsoft Windows NT Workstation | | |
Microsoft Windows Server 2003 Datacenter Edition | | |
Microsoft Windows Server 2003 Enterprise Edition | | |
Microsoft Windows Server 2003 Standard Edition | | |
Microsoft Windows Server 2003 for x64 | | |
Microsoft Windows Server 2008 | | |
Microsoft Windows Server 2008 for x64 | | |
Microsoft Windows XP Professional | | |
Windows 7 Enterprise 32 bit | | |
Windows 7 Enterprise x64 | | |
Windows 7 Home Premium 32 bit | | |
Windows 7 Home Premium x64 | | |
Windows 7 Professional 32 bit | | |
Windows 7 Professional x64 | | |
Windows 7 Ultimate 32 bit | | |
Windows 7 Ultimate x64 | | |
Windows Millennium Edition (Me) | | |
Windows Vista | | |
Windows Vista for x64 | | |
64-bit Enabled AIX | | |
64-bit Enabled HP-UX | | |
64-bit Enabled Solaris | | |
ABI+ for Intel Architecture | | |
AIX | | |
HP-UX | | |
HP-UX IPF | | |
IRIX | | |
Linux | | |
Linux for x64 | | |
Linux on Itanium | | |
OpenVMS Alpha | | |
OpenVMS on HP Integrity | | |
Solaris | | |
Solaris for x64 | | |
Tru64 UNIX | | |