View previous topic :: View next topic |
Author |
Message |
enge Beginner
Joined: 12 Oct 2004 Posts: 78 Topics: 39
|
Posted: Fri Aug 25, 2017 8:06 am Post subject: EXPONENT-OVERFLOW EXCEPTION (SYSTEM COMPLETION CODE=0CC) |
|
|
hallo, i have to calculate a data in a formula :
Code: |
COMPUTE A1WCRET-REFFN =
((A1WCRET-IPRZN(A1WCRET-INDRIM) / A1WCRET-IPRZNET)
** W-NESP - 1) * 100
ON SIZE ERROR MOVE ZEROES TO A1WCRET-REFFN.
|
where:
Code: |
A1WCRET-IPRZN(A1WCRET-INDRIM) = 87,5
A1WCRET-IPRZNET = 54,496
W-NESP = 365
|
and i get :
Code: |
THE SYSTEM DETECTED AN EXPONENT-OVERFLOW EXCEPTION (SYSTEM COMPLETION CODE=0CC).
|
i cannot resolve the problem. any idea? |
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
|
Back to top |
|
|
enge Beginner
Joined: 12 Oct 2004 Posts: 78 Topics: 39
|
Posted: Fri Aug 25, 2017 8:38 am Post subject: |
|
|
Code: |
A1WCRET-REFFN PIC S9(03)V9(09) COMP-3 the result
A1WCRET-IPRZN PIC S9(9)V9(6) COMP-3. 87.5
A1WCRET-IPRZNET PIC S9(09)V9(9) COMP-3 54.496
W-NESP PIC S9(09)V9(09) COMP-3 365
|
that is ((87.5 / 54.496) ^ 365 - 1) * 100 |
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Fri Aug 25, 2017 9:09 am Post subject: |
|
|
Is A1WCRET-INDRIM a subscript or index or are you multiplying it by A1WCRET-IPRZN? Please show your exact code to eliminate these types of questions. And use Code Tags. _________________ ....Terry |
|
Back to top |
|
|
enge Beginner
Joined: 12 Oct 2004 Posts: 78 Topics: 39
|
Posted: Fri Aug 25, 2017 9:18 am Post subject: |
|
|
sorry, forget A1WCRET-INDRIM because is just an index and the value is 1 ...the field A1WCRET-IPRZN(1) values 87.5 |
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Fri Aug 25, 2017 11:32 am Post subject: |
|
|
The problem might be your index. Remember that indexes are stored as displacements, not occurrence numbers. This is what I get:
Code: | ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
WORKING-STORAGE SECTION.
01.
05 A1WCRET-REFFN PIC S9(03)V9(09) COMP-3.
05 A1WCRET-IPRZN PIC S9(9)V9(6) COMP-3 VALUE +87.5.
05 A1WCRET-IPRZNET PIC S9(09)V9(9) COMP-3 VALUE +54496.
05 W-NESP PIC S9(09)V9(09) COMP-3 VALUE +365.
PROCEDURE DIVISION.
COMPUTE A1WCRET-REFFN =
((A1WCRET-IPRZN / A1WCRET-IPRZNET)
** W-NESP - 1) * 100
ON SIZE ERROR MOVE ZEROES TO A1WCRET-REFFN.
DISPLAY 'A1WCRET-REFFN: >' A1WCRET-REFFN '<'
GOBACK
. |
Code: | ---+----1----+----2----+----3
A1WCRET-REFFN: >10000000000}<
CFECDCE6DCCCD746FFFFFFFFFFFD4
1163953095665A0E100000000000C |
Remember to also pay attention to intermediate results. They are not what you might think. _________________ ....Terry |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Aug 25, 2017 1:33 pm Post subject: |
|
|
enge wrote: |
that is ((87.5 / 54.496) ^ 365 - 1) * 100 |
what do you think the value of the above would result in? It would end up as 1.14776E+77 and your comp-3 variable will not be able to handle it.
The question is if your intention is to calculate the exponential values why are variables defined as comp-3? shouldn't they be comp-2? _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|