%macro DepAmt(_origAmt, _DepRate, _YrsOut, _DepValue); /**************************************************************************************/ /* Name: DepAmt.sas Auth: Phil Rack */ /* Date: 5/18/2007 Revd: */ /* */ /* Desc: Calculates the amount depreciated within a given year. */ /* */ /* Where: _origamt = original price. */ /* _deprate = the depreciation rate. */ /* _Yrsout = Year of depreciation. */ /* _DepValue = the calculated depreciation amount (returned value) */ /* */ /* Copyright (C) 2007 by MineQuest, LLC. All Rights Reserved. www.minequest.com */ /**************************************************************************************/ IF (%length(%str(&_origamt)) eq 0) OR (&_origamt = '.') OR (%length(%str(&_Deprate)) eq 0) OR (&_Deprate = '.') OR (%length(%str(&_YrsOut)) eq 0) OR (&_YrsOut = '.') THEN DO; &_depvalue = .; END; ELSE DO; &_DepValue = &_origAmt * ( &_DepRate / 100) * (1 - ( &_DepRate /100)) ** ( &_YrsOut - 1); END; /********************************************************************************************/ /* DepAmt is Copyright (c) 2007 by MineQuest, LLC. All Rights Reserved. */ /* MineQuest, LLC, 1939 Queensbridge Dr., Columbus, OH USA. */ /* This Macro Program is proprietary software and is licensed property of MineQuest, LLC. */ /********************************************************************************************/ %mend DepAmt;