Updating Values in Existing Table Rows
Overview
To modify data values in
some or all of the existing rows in a table, you use the UPDATE statement
in PROC SQL. In the UPDATE statement, for each column whose rows you
want to modify, you specify an expression that indicates how the values
should be modified. For example, the following expression indicates
that the values for the column Units should be multiplied by 4:
units=units*4
You can use the UPDATE
statement in two main ways.
Method of Updating Table
|
Example
|
---|---|
update all (or a subset
of) rows in a column with the same expression
|
proc sql;
update work.payrollmaster_new
set salary=salary*1.05
where jobcode like '__1'; |
update different rows in a column with different expressions ... |
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.