View previous topic :: View next topic
|
Author |
Message |
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
Hi,
I was trying to add few columns along the same row. I used the code as listed below using ice tool. My expected O/P is in the form of ZD but i was getting something different.
Code: |
OUTREC IFTHEN=(WHEN=INIT,
OVERLAY=(406:C'00000{',412:C'00000{',
418:(365,14,ZD,ADD,337,14,ZD,ADD,323,14,ZD,TO=ZD,LENGTH=14)))
|
Th I/P file has Lrecl of 433 (FB) and so as the O/P.
the fields which i want to sum up is of length 14. The corresponding Cobol declaration is "S9(10)V9(4)".
My field A,B,C has the following values:
A= 0000000209120M
B= 0000000000000{
C= 0000000000000{
My O/P is something like this: 2091204- (Even though the computed value is correct, it is not displayed as 0000000209120M).
Pls let me know whats wrong and pls try to suggest a solution in ICETool rather than in ice man or in other ... (Because this particular case is one of the condition which needs to be implemented in a single control card... )
Thanks in Advance. |
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
I think the O/P is editted before they are displayed... Pls let me know if there is any way to display the ZD value as it is (without editting or formatting) ... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I'm not sure how you're getting what you say you're getting. M is X'D4' which is a -4. With TO=ZD, you should get a D sign. But your syntax does seem to have the parens in the wrong places. Try this:
Code: |
OUTREC IFTHEN=(WHEN=INIT,
OVERLAY=(406:C'00000{',412:C'00000{',
418:(365,14,ZD,ADD,337,14,ZD,ADD,323,14,ZD),TO=ZD,LENGTH=14))
|
You can also use TO=ZDF if you want an F sign for positive values or TO=ZDC if you want a C sign for positive values. For DFSORT, TO=ZDF and TO=ZD are equivalent. |
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
Quote: |
But your syntax does seem to have the parens in the wrong places
? |
Ya..there braces wer not in places... I have corrected that.
Pls let me know how to identify whether there is a overflow or not ? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Pls let me know how to identify whether there is a overflow or not ?
|
Huh? Who said anything about overflow? Overflow of what? |
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
I have to multiply a big number ( 9(10)V9(4) with another 9(10)V9(4) ) so i ll get a number larger than the 10 digits. If I mention the length as 10, will this not truncate the result. How do i make sure that there is no overflow/truncation in the result.Any specific method to identify.Pls clarify me on this.
Thanks, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
To avoid overflow, just use a LENGTH=n value that will allow for the largest result possible. The number of digits can be up to 31. n can be up to 44 (to allow for separators, etc). So, for example, you could use
...,TO=ZD,LENGTH=31 |
|
Back to top |
|
|
|