Previous Page | Next Page

Automatic Macro Variables

SYSLAST Automatic Macro Variable



Contains the name of the SAS data file created most recently.
Type: Automatic macro variable (read and write)
See also: SYSDSN Automatic Macro Variable

Details
Comparisons
Examples
Example 1: Comparing Values Produced by SYSLAST and SYSDSN

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.

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.  [cautionend]


Comparisons


Examples


Example 1: 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.

Previous Page | Next Page | Top of Page