View previous topic :: View next topic |
Author |
Message |
sudoku Beginner
Joined: 14 Aug 2006 Posts: 10 Topics: 4
|
Posted: Sun Sep 24, 2006 2:14 am Post subject: Cobol Declaration problem |
|
|
Hi,
I have a problem with cobol declaration for the following:
For a 6 digit field, Positive values in format 999.99 negative values in format -99.99, zero in format 000.00
Any suggestions are welcome!
Thanks,
Sudoku |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Sep 25, 2006 9:09 am Post subject: |
|
|
Quote: |
For a 6 digit field, Positive values in format 999.99 negative values in format -99.99, zero in format 000.00
|
Sudoku,
what happens if your input is less than or equal to -100.00 ? How are you planning to store the integer part in 2 digits as the leading byte is taken by the sign.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
sudoku Beginner
Joined: 14 Aug 2006 Posts: 10 Topics: 4
|
Posted: Mon Sep 25, 2006 3:45 pm Post subject: |
|
|
Kolusu,
We will never have -100.00. The value will always be between 999.99 and -99.99
One option I am thinking of is to use redefined structures and do a -ve check.
Eg: 05 A PIC 9(03).99
05 B REDEFINES A PIC -9(02).99
Any suggestions from your side!
Thanks,
Sudoku |
|
Back to top |
|
|
|
|