%macro Compound(_p,_i, _y, _n, _fv); /**************************************************************************************/ /* Name: Compound.sas Auth: Phil Rack */ /* Date: 5/16/2007 Revd: */ /* */ /* Desc: Returns the future value of an investment when interest is a factor. */ /* */ /* Where: _p = The loan principal. */ /* _i = The loan interest rate. (The Returned Value) */ /* _y = The loan term in years. */ /* _n = The loan term in months. */ /* _fv = The calculated loan payment. */ /* */ /* Copyright (C) 2007 by MineQuest, LLC. All Rights Reserved. www.minequest.com */ /**************************************************************************************/ IF (%length(%str(&_p)) eq 0) or (&_p = '.') OR (%length(%str(&_i)) eq 0) or (&_i = '.') OR (%length(%str(&_y)) eq 0) or (&_y = '.') OR (%length(%str(&_n)) eq 0) or (&_n = '.') THEN DO; &_fv = .; END; ELSE DO; &_fv = &_p * (1 + (&_i/ &_n / 100)) ** (&_n * &_y); END; /******************************************************************************************/ /* Compound 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 Compound;