|SAS Macro Language: Reference|
Automatic macro variables are created by the macro processor and they supply a variety of information. They are useful in programs, for example 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, for example &SYSLAST or &SYSJOBID.
For example, suppose you want to include today's day and date in a FOOTNOTE statement. Write the statement to reference the automatic macro variables SYSDAY and SYSDATE9, as shown here:
footnote "Report for &sysday, &sysdate9";
If you run the program on June 15, 2001, macro variable resolution causes the SAS System to see this statement:
FOOTNOTE "Report for Friday, 15JUN2001";
All automatic variables except for SYSPBUFF are global and are created when you invoke the SAS System. Automatic Macro Variables lists the automatic macro variables and describes their READ and WRITE status.
Top of Page
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.