Grouping Statements Using DO Groups

Overview

So far in this chapter, you've seen examples of conditional processing (IF-THEN/ELSE statements and SELECT groups) that execute only a single SAS statement when a condition is true. However, you can also execute a group of statements as a unit by using DO groups.
To construct a DO group, you use the DO and END statements along with other SAS statements.
General form, simple DO group:
DO;
SAS statements
END;
where
  • the DO statement begins DO group processing
  • SAS statements between the DO and END statements are called a DO group and execute as a unit
  • the END statement terminates DO group processing.
You can nest DO statements within DO groups.
You can use DO groups ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.