Opening Balance addition depreciation and closing balance

Reply
New Contributor
Posts: 2

Opening Balance addition depreciation and closing balance

Hi I am facing problem in calculating the below, pl help.

MonthOpbalAdditiondepreciationclosing bal
120001500@2% of opbalopbal+addition-depreciation
2closing bal of month 1

The table needs to be created for 36 months in similar manner.

Thanking in advance.

Super Contributor
Posts: 644

Re: Opening Balance addition depreciation and closing balance

Data want ;

     length month 8 ;

     openbal = 2000 ;

     addition = 1500 ;

     do month = 1  to 36 ;

          depreciation = openbal / 50 ; /* 2 % */

          closingbal = openbal + addition - depreciation ;

          output ;

          openbal = closingbal ;

     end ;

run ;

[untested]

Richard

New Contributor
Posts: 2

Re: Opening Balance addition depreciation and closing balance

Thanks but it does not give me desired result.

month opbal addition depreciation closbal

120001500@2% of opbalopbal+addition-depreciation
2closing bal of month 12000@2% of opbalopbal+addition-depreciation

3 closing bal of month 2     3000     @2% of opbal opbal+addition-depreciation

so on for 36 months.... additions every month will differ and are available. pl help.

Valued Guide
Posts: 2,175

Re: Opening Balance addition depreciation and closing balance

lets assume you have transaction data which represents those additions but can be summarized..

proc summary nway data = transactions( keep = tran_date tran_amt ) ;

class  tran_date ;

format tran_date monyy7. ;

output out= additions( keep= tran_date addition ) sum= addition ;

run ;

* no need to allow for a month with no addition ;

* data are in month order ;

data closing_bals ;

* most of code from ;

* openbal+addition-depreciation ;

retain openbal 1500 ;

set additions ;

    depreciation = openbal / 50 ; /* 2 % */

    closingbal = openbal + addition - depreciation ;

    output ;

    openbal = closingbal ;

run ;

Ask a Question
Discussion stats
  • 3 replies
  • 406 views
  • 0 likes
  • 3 in conversation