View previous topic :: View next topic
|
Author |
Message |
Prase
New User
Joined: 07 Oct 2011 Posts: 6 Location: INDIA
|
|
|
|
Hi,
I need to sum the field which has equivalent cobol declaration as Pic 9 (18).99 through Sort. I tried converting the field directly to PD using below code, but the sum field operation failed with S0C7 as the decimal conversion is not happening properly. Can anyone suggest me a method to convert the decimal data to packed decimal through sort ?
Conversion I used:
Outrec fields=(1,90,91,21, ZD,TO=PD,Length=11)
Sample value:
000000000000002645.56
000000000000003600.05
Thanks in advance
Regards,
Praseetha |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I wonder when I see definitions like that (which require the use of compiler option ARITH(EXTEND). If you have 18 significant digits, what use are two decimal places? If two decimal places are significant, then you'll have a considerable number of leading zeros.
Anyway...
Please copy/paste from your emulator, don't re-type. We don't want to chase typos. Please use the Code tags.
Have a look at the Fields Box sticky at the top of the forum.
A "." is not valid in a ZD, so you are using an incorrect field-definition. If you try with UFF instead, see if you get what you want. |
|
Back to top |
|
|
Prase
New User
Joined: 07 Oct 2011 Posts: 6 Location: INDIA
|
|
|
|
Thank you Bill.. that worked..!!! |
|
Back to top |
|
|
|