Posted: Wed Aug 12, 2009 12:37 pm Post subject: SORT SUM
I want to sum the amounts that are at position 10,12,ZD. I want to sum all the amounts. And out should contain only the total amount. I tried with the below statement, but I'm not getting the sum, it is only displaying all the records in the output. Please help me.
Thank you arcvns for qucik reply. This is working fine. My field declaration is S9(9)V99. So the out put is displaying without decimal. Can I get with decimal out put with sign like +123.45 or -123.45. And does this sysntax is valid for packed data also? for packed I'm not getting correct output. Field declaration is S9(9).
Last edited by SRI123 on Wed Aug 12, 2009 4:29 pm; edited 1 time in total
Joined: 18 Feb 2006 Posts: 812 Location: San Jose, CA
Posted: Wed Aug 12, 2009 8:35 pm Post subject:
I believe that data is equivalent to a 2-byte PD field starting at position 15 interpreted as a sd.dd value.
A total for that value could overflow sd.dd so you would probably want to display it as a larger values, something like sdddd.dd depending on what you want the output value to look like. As an example, you could use these DFSORT statements:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum