SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating Variables
Accumulating Totals


Suppose you want to create the data set Finance.Newloan by reading and modifying data from Finance.Records:

SAS Data Set Finance.Records
Account Amount Rate Months Payment Code
101-1092 22000 0.1000 60 467.43 1
101-1731 114000 0.0950 360 958.57 2
101-1289 10000 0.1050 36 325.02 2
101-3144 3500 0.1050 12 308.52 1


For the new data set, you want to drop the variables Amount and Rate and create the variable TotalLoan to accumulate the total of loan payments:

SAS Data Set Finance.Newloan
Account Months Payment Code TotalLoan
101-1092 60 467.43 1 467.43
101-1731 360 958.57 2 1426.00
101-1289 36 325.02 2 1751.02
101-3144 12 308.52 1 2059.54


Let's see how you create this variable.


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement