Creating a Macro Variable during DATA Step Execution


In many applications, you need to create macro variables during DATA step execution. You might need to create macro variables and to assign values to them based on the following:
  • data values in SAS data sets or in external files
  • programming logic
  • computed values.
For example, suppose you want to create a report that lists students who are enrolled in a specific course, according to data in the Sasuser.All data set. Suppose you want to include a footnote in your report to indicate whether any student fees are unpaid.
The following program uses SAS programming logic to determine which value is assigned to the macro variable foot. Then foot is referenced in the FOOTNOTE ...

Get SAS Certification Prep Guide, 4th Edition now with O’Reilly online learning.

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