Modifying a SAS Data Set: The Simplest Case

You can use the MODIFY statement to replace all values for a specific variable or variables in a data set. The syntax for using the MODIFY statement for this purpose is
MODIFY SAS-data-set;
In the following program, the price of each part in the inventory is increased by 15%. The new values for PRICE replace the old values on all records in the original INVENTORY_TOOL data set. The FORMAT statement in the print procedure writes the price of each item with two-digit decimal precision.
data inventory_tool;
   modify inventory_tool;
   price=price+(price*.15);
run;

proc print data=inventory_tool;
   title 'Tool Warehouse Inventory';
   title2 '(Price reflects 15% increase)';
   format price 8.2;
run;
The following ...

Get Step-by-Step Programming with Base SAS 9.4 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.