%macro DepRate(_origAmt, _resaleValue, _YrsOut, _depRateValue); /**************************************************************************************/ /* Name: DepRate.sas Auth: Phil Rack */ /* Date: 5/18/2007 Revd: */ /* */ /* Desc: Calculates the Rate depreciated within a given year. */ /* */ /* Where: _origamt = original price. */ /* _ResaleValue = the resale price. */ /* _Yrsout = Age in years. */ /* _DepRateValue = the calculated depreciation rate (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(&_ResaleValue)) eq 0) OR (&_ResaleValue = '.') OR (%length(%str(&_YrsOut)) eq 0) OR (&_YrsOut = '.') THEN DO; &_DepRateValue = .; END; ELSE DO; &_DepRateValue = 100 * ( 1 - ( &_ResaleValue / &_origAmt) ** (1/ &_YrsOut)); END; /********************************************************************************************/ /* DepRate 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 DepRate;