Previous Page | Next Page

Automatic Macro Variables

SYSDSN Automatic Macro Variable

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

Comparing Values Produced by SYSDSN and SYSLAST


The libref and data set name are displayed in two left-aligned fields. If no SAS data set has been created in the current program, SYSDSN returns eight blanks followed by _NULL_ followed by two more blanks.

Note:   The macro processor always stores the value of SYSDSN in unquoted form. To quote the resolved value of SYSDSN, use the %SUPERQ macro quoting function.  [cautionend]



Example 1: Comparing Values Produced by SYSDSN and SYSLAST

Create a data set WORK.TEST and then enter the following statements:

%put Sysdsn produces:  *&sysdsn*;
%put Syslast produces: *&syslast*;

When these statements execute, the following lines are written to the SAS log:

Sysdsn produces:  *WORK    TEST    *
Syslast produces: *WORK.TEST    *

When the libref or data set name contain fewer than eight characters, SYSDSN maintains the blanks for the unused characters. SYSDSN does not display a period between the libref and data set name fields.

Previous Page | Next Page | Top of Page