|
||
IntroductionSAS macro variables enable you to substitute text in your SAS programs. Macro variables can supply a variety of information, including
When you reference a macro variable in a SAS program, SAS replaces the reference with the text value that has been assigned to that macro variable. By substituting text into programs, SAS macro variables make your programs more reusable and dynamic. The following sample code shows how a macro variable might be used
to substitute a year value throughout a program, enabling you to quickly
and easily change the value of %let year=2002; proc print data=sasuser.schedule; where year(begin_date)=&year; title "Scheduled Classes for &year"; run; proc means data=sasuser.all sum; where year(begin_date)=&year; class location; var fee; title1 "Total Fees for &year Classes"; title2 "by Training Center"; run; |
Time to CompleteThis lesson contains pages and takes approximately 1.5 hours to complete. |
ObjectivesIn this lesson, you learn to
|
PrerequisitesBefore taking this lesson, you should complete the following lessons:
|
Copyright
© 2003 SAS Institute Inc.,
Cary, NC, USA. All rights reserved. Terms of Use & Legal Information | Privacy Statement |