Automatic Macro Variables

Automatic macro variables are created by the macro processor and they supply a variety of information. They are useful in programs to check the status of a condition before executing code. When you use automatic macro variables, you reference them the same way that you do macro variables that you create such as &SYSLAST or &SYSJOBID.
CAUTION:
Do not create macro variable names that begin with SYS.
The three-letter prefix SYS is reserved for use by SAS for automatic macro variables. For a complete list of reserved words in the macro language, see Reserved Words in the Macro Facility.
For example, suppose you want to include the day and date that your current SAS session was invoked. Write the FOOTNOTE statement to reference the automatic macro variables SYSDAY and SYSDATE9:
footnote "Report for &sysday, &sysdate9";
If the current SAS session was invoked on June 13, 2007, macro variable resolution causes SAS to see this statement:
FOOTNOTE "Report for Friday, 13JUN2007";
All automatic variables except for SYSPBUFF are global and are created when you invoke SAS. The following table lists the automatic macro variables and describes their READ and WRITE status.
Automatic Macro Variables
Variable
Read and Write Status
SYSADDRBITS
Read-only
SYSBUFFR
Read and write
SYSCC
Read and write
SYSCHARWIDTH
Read-only
SYSCMD
Read and write
SYSDATE
Read-only
SYSDATE9
Read-only
SYSDAY
Read-only
SYSDEVIC
Read and write
SYSDMG
Read and write
SYSDSN
Read and write
SYSENCODING
Read-only
SYSENDIAN
Read-only
SYSENV
Read-only
SYSERR
Read-only
SYSERRORTEXT
Read only
SYSFILRC
Read and write
SYSHOSTNAME
Read-only
SYSINDEX
Read-only
SYSINFO
Read-only
SYSJOBID
Read-only
SYSLAST
Read and write
SYSLCKRC
Read and write
SYSLIBRC
Read and write
SYSLOGAPPLNAME
Read-only
SYSMACRONAME
Read-only
SYSMENV
Read-only
SYSMSG
Read and write
SYSNCPU
Read-only
SYSNOBS
Read-only
SYSODSESCAPECHAR
Read-only
SYSODSPATH
Read-only
SYSPARM
Read and write
SYSPBUFF
Read and write
SYSPROCESSID
Read-only
SYSPROCESSNAME
Read-only
SYSPROCNAME
Read-only
SYSRC
Read and write
SYSSCP
Read-only
SYSSCPL
Read-only
SYSSITE
Read-only
SYSSIZEOFLONG
Read-only
SYSSIZEOFPTR
Read-only
SYSSIZEOFUNICODE
Read-only
SYSSTARTID
Read-only
SYSSTARTNAME
Read-only
SYSTCPIPHOSTNAME
Read-only
SYSTIME
Read-only
SYSUSERID
Read-only
SYSVER
Read-only
SYSVLONG
Read-only
SYSVLONG4
Read-only
SYSWARNINGTEXT
Read-only