Skip to Main Content
SAS Certified Professional Prep Guide
book

SAS Certified Professional Prep Guide

by SAS Institute
October 2019
Intermediate to advanced content levelIntermediate to advanced
430 pages
19h 4m
English
SAS Institute
Content preview from SAS Certified Professional Prep Guide

Iterative Processing

The %DO Statement

A Brief Overview

Many macro applications require iterative processing. With the iterative %DO statement you can do the following repeatedly:
  • execute macro programming code
  • generate SAS code
The iterative %DO and %END statements are valid only inside a macro definition. The index variable is created in the local symbol table if it does not appear in any existing symbol table.
The iterative %DO statement evaluates the value of the index variable at the beginning of each loop iteration. The loop stops processing when the index variable has a value that is outside the range of the start and stop values.

%DO Syntax

Syntax, iterative %DO statement with %END statement:
%DO index-variable=start ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SAS Certified Specialist Prep Guide

SAS Certified Specialist Prep Guide

SAS Institute
SAS in Practice

SAS in Practice

Ekta Saraogi

Publisher Resources

ISBN: 9781642954692