View previous topic :: View next topic |
Author |
Message |
jayram99 Beginner
Joined: 16 Aug 2004 Posts: 52 Topics: 21 Location: falls church.va,usa
|
Posted: Tue May 20, 2008 8:35 am Post subject: Coding Zoned Decimal Data |
|
|
Hi,
I have data in the Dataset as below.
1 000092029.37
2 000068176.62
3 000100868.39
4 000046831.64
5 000181287.99
The output i should i get is
489194.01
Want to sum the values from 3,12 using SYNCSORT utility. I tried with the methods specified in the forum but getting S0C7.
Please suggest me.
Jay |
|
Back to top |
|
|
CraigG Intermediate
Joined: 02 May 2007 Posts: 202 Topics: 0 Location: Viginia, USA
|
Posted: Tue May 20, 2008 8:56 am Post subject: |
|
|
It whould help if you showed the control cards you are using. Those are not zoned decimal numbers (. is not a number). |
|
Back to top |
|
|
vij Beginner
Joined: 13 Dec 2002 Posts: 6 Topics: 2
|
Posted: Tue May 20, 2008 9:29 am Post subject: |
|
|
Code: | //*-------------------------------------------------------------------*
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
000092029.37
000068176.62
000100868.39
000046831.64
000181287.99
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC FIELDS=(C' ',1,9,11,2)
SORT FIELDS=(1,1,CH,A)
SUM FIELDS=(2,11,ZD)
OUTREC FIELDS=(2,9,C'.',11,2)
//*-------------------------------------------------------------------* |
|
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue May 20, 2008 9:46 am Post subject: |
|
|
If you had looked first you would have found a section in the DFSORT Tricks document titled"Sum a number with a decimal point" which is exactly what you want. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
|
|