View previous topic :: View next topic |
Author |
Message |
nachiyappan Beginner
Joined: 08 Sep 2020 Posts: 8 Topics: 2
|
Posted: Sun Feb 28, 2021 11:08 pm Post subject: DFSORT yield rate calculation |
|
|
Hi, I have interest rate in a file in a fixed position. Is it possible to get the yield rate using DFSORT by performing the following formula
Yield rate = (((((interest rate / 100 ) / 365) + 1)^365) - 1) * 100
I am trying to replace a COBOL which is performing a simple move of selective fields from input and just performing this calc to be written to a new field in the output
I tried searching and doesn't seem to find an answer. If this is answered, then please refer to me that thread. Thanks in advance. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Mar 01, 2021 11:31 am Post subject: |
|
|
nachiyappan,
SORT products do NOT have the capability of doing the exponent. Moreover you also need to perform rounding which can be tricky with Sort products.
For example for an interest rate of 5% how do you round up? What is the yield rate 5.12675 or 5.127 ? or 5.13? _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
nachiyappan Beginner
Joined: 08 Sep 2020 Posts: 8 Topics: 2
|
Posted: Mon Mar 01, 2021 2:04 pm Post subject: |
|
|
Hi Kolusu,
Thanks for your quick reply. For example of 5% interest rate, the yield rate is 5.12675. Both interest rate and yield rate are PD . COBOL definition for both is PIC S9(03)V9(05) COMP-3. (Length is 5).
Thanks,
Nachi |
|
Back to top |
|
 |
|
|