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. You reference automatic macro variables such as &SYSLAST or
&SYSJOBID the same way you do macro variables that you create.
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 Appendix 1, “ Reserved Words in the
Macro Facility,” on page 391.
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.
Table 12.9 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
SYSDATASTEPPHASE Read-only
SYSDATE Read-only
SYSDATE9 Read-only
SYSDAY Read-only
SYSDEVIC Read and write
Automatic Macro Variables 167
Variable Read and Write Status
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
SYSHOSTINFOLONG Read-only
SYSHOSTNAME Read-only
SYSINCLUDEFILEDEVICE Read-only
SYSINCLUDEFILEDIR Read-only
SYSINCLUDEFILEFILEREF Read-only
SYSINCLUDEFILENAME 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
SYSMAXLONG Read-only
SYSMENV Read-only
SYSMSG Read and write
168 Chapter 12 Macro Language Elements
Variable Read and Write Status
SYSNCPU Read-only
SYSNOBS Read-only
SYSODSESCAPECHAR Read-only
SYSODSPATH Read-only
SYSPARM Read and write
SYSPBUFF Read and write
SYSPRINTTOLIST Read-only
SYSPRINTTOLOG Read-only
SYSPROCESSID Read-only
SYSPROCESSMODE 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
SYSTIMEZONE Read-only
SYSTIMEZONEIDENT Read-only
Automatic Macro Variables 169
..................Content has been hidden....................

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