Modifying All Observations in a SAS Data Set

Overview

When every observation in a SAS data set requires the same modification, you can use the MODIFY statement and specify the modification using an assignment statement.
General form, MODIFY statement with an assignment statement:
DATA SAS-data-set;
MODIFY SAS-data-set;
existing-variable = expression;
RUN;
Here is an explanation of the syntax:
SAS-data-set
is the name of the SAS data set that you want to modify.
existing-variable
is the name of the variable whose values you want to update.
expression
is a function or other expression that you want to apply to the variable.

Example

Suppose an airline has decided to give passengers more leg room. The airline must ...

Get SAS Certification Prep Guide, 4th 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.