Type: Automatic macro variable (read-only)
Details
You can use SYSINCLUDEFILEDEVICE to determine the device type of the current
%INCLUDE file.
SYSINCLUDEFILEDIR Automatic Macro Variable
Contains the directory where the current %INCLUDE file was found.
Type: Automatic macro variable (read-only)
Details
You can use SYSINCLUDEFILEDIR to determine which directory the current
%INCLUDE file was found.
SYSINCLUDEFILEFILEREF Automatic Macro Variable
Contains the fileref that is associated with the current %INCLUDE file or blank.
Type: Automatic macro variable (read-only)
Details
You can use SYSINCLUDEFILEFILEREF to determine whether a fileref was used to
access the current %INCLUDE file. If no fileref was used, then the value is blank.
SYSINCLUDEFILENAME Automatic Macro Variable
Contains the filename of the current %INCLUDE file.
Type: Automatic macro variable (read-only)
Details
You can use SYSINCLUDEFILENAME to determine the name of the current
%INCLUDE file.
SYSINDEX Automatic Macro Variable
Contains the number of macros that have started execution in the current SAS job or session.
Type: Automatic macro variable (read only)
SYSINDEX Automatic Macro Variable 213
Details
You can use SYSINDEX in a program that uses macros when you need a unique number
that changes after each macro invocation.
SYSINFO Automatic Macro Variable
Contains return codes provided by some SAS procedures.
Type: Automatic macro variable (read only)
Details
Values of SYSINFO are described with the procedures that use it. You can use the value
of SYSINFO as a condition for determining further action to take or parts of a SAS
program to execute.
For example, PROC COMPARE, which compares two data sets, uses SYSINFO to store
a value that provides information about the result of the comparison.
SYSJOBID Automatic Macro Variable
Contains the name of the current batch job or user ID.
Type: Automatic macro variable (read only)
See: “Automatic Macro Variables in UNIX Environments” in SAS Companion for UNIX
Environments
“Automatic Macro Variables” in SAS Companion for Windows
“Macro Variables” in SAS Companion for z/OS
Details
The value stored in SYSJOBID depends on the operating environment that you use to
run SAS. You can use SYSJOBID to check who is currently executing the job to restrict
certain processing or to issue commands that are specific to a user.
SYSLAST Automatic Macro Variable
Contains the name of the SAS data file created most recently.
Type: Automatic macro variable (read and write)
See: “SYSDSN Automatic Macro Variable” on page 206
Details
The name is stored in the form libref.dataset. You can insert a reference to SYSLAST
directly into SAS code in place of a data set name. If no SAS data set has been created in
the current program, the value of SYSLAST is _NULL_, with no leading or trailing
blanks.
214 Chapter 14 Automatic Macro Variables
Note: The macro processor always stores the value of SYSLAST in unquoted form. To
quote the resolved value of SYSLAST, use the %SUPERQ macro quoting function.
Comparisons
Assigning a value to SYSLAST is the same as specifying a value for the _LAST_=
system option.
The value of SYSLAST is often more useful than SYSDSN because the value of
SYSLAST is formatted so that you can insert a reference to it directly into SAS code
in place of a data set name.
Example: Comparing Values Produced by SYSLAST and
SYSDSN
Create the data set FirstLib.SalesRpt and then enter the following statements:
%put Sysdsn produces: *&sysdsn*;
%put Syslast produces: *&syslast*;
When these statements are executed, the following is written to the SAS log:
Sysdsn produces: *FIRSTLIBSALESRPT*
Syslast produces: *FIRSTLIB.SALESRPT*
The name stored in SYSLAST contains the period between the libref and data set name.
SYSLCKRC Automatic Macro Variable
Contains the return code from the most recent LOCK statement.
Type: Automatic macro variable (read and write)
Details
The LOCK statement is a Base SAS software statement used to acquire and release an
exclusive lock on data objects in data libraries accessed through SAS/SHARE software.
The following are values for SYSLCKRC:
Table 14.7 LCKRC Values and Descriptions
Value Description
0 The last LOCK statement was successful.
>0 The last LOCK statement was not successful.
<0 The last LOCK statement was completed, but a WARNING or NOTE was
written to the SAS log.
For more information, see the documentation for SAS/SHARE software.
SYSLCKRC Automatic Macro Variable 215
SYSLIBRC Automatic Macro Variable
Contains the return code from the last LIBNAME statement.
Type: Automatic macro variable (read and write)
Details
The code reports whether the last LIBNAME statement executed correctly. SYSLIBRC
checks whether the SAS library referenced by the last LIBNAME statement exists. For
example, you could use SYSLIBRC to confirm that a libref is allocated before you
attempt to access a permanent data set.
The following are values for SYSLIBRC:
Table 14.8 SYSLIBRC Values and Descriptions
Value Description
0 The last LIBNAME statement executed correctly.
≠0 The last LIBNAME statement did not execute correctly.
SYSLOGAPPLNAME Automatic Macro Variable
Contains the value of the LOGAPPLNAME= system option.
Type: Automatic macro variable (read only)
Default: null
Details
The following code, when submitted from the current SAS session, writes the
LOGAPPLNAME for the current SAS session to the log:
%put &syslogapplname;
SYSMACRONAME Automatic Macro Variable
Returns the name of the currently executing macro.
Type: Automatic macro variable (read only)
Details
When referenced outside of an executing macro, SYSMACRONAME returns the null
string.
216 Chapter 14 Automatic Macro Variables
SYSMAXLONG Automatic Macro Variable
Returns the maximum long integer value allowed under Linux.
Type: Automatic macro variable (read-only)
Details
The SYSMAXLONG automatic macro variable returns the maximum long integer value
allowed under Linux, which is 2,147,483,647. On 64-bit systems, the maximum is
9,007,199,254,740,992.
SYSMENV Automatic Macro Variable
Contains the invocation status of the macro that is currently executing.
Type: Automatic macro variable (read only)
Details
The following are values for SYSMENV:
Table 14.9 SMENV Values and Descriptions
Value Description
S
The macro currently executing was invoked as part of a SAS program.
D
The macro currently executing was invoked from the command line of a
SAS window.
SYSMSG Automatic Macro Variable
Contains text to display in the message area of a macro window.
Type: Automatic macro variable (read and write)
Details
Values assigned to SYSMSG do not require quotation marks. The value of SYSMSG is
set to null after each execution of a %DISPLAY statement.
Example: %DISPLAY Statement
This example shows that text assigned to SYSMSG is cleared after the %DISPLAY
statement.
SYSMSG Automatic Macro Variable 217
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset