Status Variable Contains
SYSTIMEZONEOFFSET The current time zone offset based on
TIMEZONE option
SYSUSERID The user ID or login of the current SAS process
SYSVER The release or version number of SAS software
executing
SYSVLONG The release number and maintenance level of SAS
software with a 2-digit year
SYSVLONG4 The release number and maintenance level of SAS
software with a 4-digit year
SYSWARNINGTEXT Text of the last warning message formatted for
display on the SAS log
Macro Variables Defined by Users
Overview for Defining Macro Variables
You can create your own macro variables, change their values, and define their scope.
You can define a macro variable within a macro, and you can also specifically define it
as a global variable, by defining it with the %GLOBAL statement. Macro variable
names must start with a letter or an underscore and can be followed by letters or digits.
You can assign any name to a macro variable as long as the name is not a reserved word.
The prefixes AF, DMS, SQL, and SYS are not recommended because they are frequently
used in SAS software when creating macro variables. Thus, using one of these prefixes
can cause a name conflict with macro variables created by SAS software. For a complete
list of reserved words in the macro language, see Appendix 1, “ Reserved Words in the
Macro Facility,” on page 379. If you assign a macro variable name that is not valid, an
error message is printed in the SAS log.
You can use %PUT _ALL_ to view all user-created macro variables.
Creating User-Defined Macro Variable Names
The simplest way to create a user-defined macro variable is to use the macro program
statement %LET:
%let dsname=Newdata;
DSNAME is the name of the macro variable. Newdata is the value of the macro
variable DSNAME. The following are the rules for creating a macro variable:
1. SAS macro variable names can be up to 32 characters in length.
2. The first character must begin with a letter or an underscore. Subsequent characters
can be letters, numeric digits, or underscores.
3. A macro variable name cannot contain blanks.
26 Chapter 3 Macro Variables

Get SAS 9.4 Macro Language: Reference, Fourth Edition, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.