Updating with Incremental Values
Some applications do not
update a data set by overwriting values in the master data set with
new values from a transaction data set. Instead, they update a variable
by mathematically manipulating its value based on the value of a variable
in the transaction data set.
In this example, a bookstore
uses SAS to keep track of weekly sales and year-to-date sales. The
program that follows creates, sorts by Title, and displays the data
set, YEAR_SALES, which contains the year-to-date information.
data year_sales;
input Title $ 1-25 Author $ 27-50 Sales; datalines; The Milagro Beanfield War Nichols, John 303 The Stranger Camus, Albert 150 Always Coming Home LeGuin, Ursula 79 Falling through Space Gilchrist, Ellen 128 ...
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.