Chapter Summary

Text Summary

Accumulating Totals

Use a sum statement to add the result of an expression to an accumulator variable.

Initializing and Retaining Variables

You can use the RETAIN statement to assign an initial value to a variable whose value is assigned by a sum statement.

Assigning Values Conditionally

To perform an action conditionally, use an IF-THEN statement. The IF-THEN statement executes a SAS statement when the condition in the IF expression is true. You can include comparison and logical operators; logical comparisons that are enclosed in parentheses are evaluated as true or false before other expressions are evaluated. Use the ELSE statement to specify an alternative action when the condition in an IF-THEN ...

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.