Usage Note 8707: In the SAS® Enhanced Editor, SAS® Enterprise Guide, or SAS® Studio, how to obtain the filename and full path of submitted programs or catalog entries
Introduced in SAS® 9, you can now obtain the filename and full path
of submitted programs and catalog entries when they are submitted
interactively from the Enhanced Editor.
For SAS® Enterprise Guide® or SAS® Studio:
Use the %put &_SASPROGRAMFILE; macro variable, noted at the bottom of SAS KB0039559: "How to retrieve the program name that is currently running in batch mode or interactively."
For SAS 9 Enhanced Editor:
The environment variable, SAS_EXECFILEPATH, contains the full path of
the submitted program or catalog entry. The full path includes the
folder and the filename. The environment variable, SAS_EXECFILENAME,
contains only the name of the submitted program or the catalog
entry name. You can then extract the filename and full path for
use in your SAS programs, using the SAS code:
%put %sysget(SAS_EXECFILENAME);
%put %sysget(SAS_EXECFILEPATH);
For example, the following title statement and footnote
use the new variables:
title "This output is from file: %sysget(SAS_EXECFILENAME)"; run;
footnote "The full path is: %sysget(SAS_EXECFILEPATH)"; run;
Operating System and Release Information
SAS System | Base SAS | Microsoft® Windows® for 64-Bit Itanium-based Systems | 9 TS M0 | |
Microsoft Windows NT Workstation | 9 TS M0 | |
Microsoft Windows 2000 Server | 9 TS M0 | |
Microsoft Windows 2000 Advanced Server | 9 TS M0 | |
Microsoft Windows 2000 Professional | 9 TS M0 | |
Microsoft Windows 2000 Datacenter Server | 9 TS M0 | |
Microsoft Windows XP Professional | 9 TS M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Date Modified: | 2021-02-23 20:35:39 |
Date Created: | 2002-10-21 11:14:10 |