Page 1 of 1

Summing up of values using Syncsort

Posted: Thu Nov 15, 2007 10:12 am
by anu.slaksh
I hav a doubt.
my input file is of length 850..

ACNO X(9) - POSITION 9
AMT S9(15)V9(3) - POSITION 347

for same accounts i need to sum the amount values and those with single accounts original amt value should be taken and written to the output file.

i used..

INREC FIELDS=(1,9,12:347,10)
SORT FIELDS=(9,9,CH,A)
SUM FIELDS=(10,10,PD)

but am gettin sum fields overlap..
can anyone help me out..

Posted: Thu Nov 15, 2007 2:02 pm
by anu.slaksh
sorry above error is solved..

Posted: Thu Nov 15, 2007 4:32 pm
by anu.slaksh
i have one more doubt..

i have 3 input files

input file 1: FB/850 (duplicates exists)
---------------------------------------------
acct x(9) - position 9
amt s9(15)v9(3) comp-3 - postion 347

input file 2: FB/200:(no duplicates)
-----------------------
acct x(9) - postion 9
add x(3) - positon 114

input file 3: FB/162:(no duplicates)
----------------------
acct x(9) - position 1
balance s9(15)v9(3) comp-3 - postion 33 (declared as array with occurs 10 times)

here i need to
1) add the amt values for same accts
2) add the 10 balance values for a single account
3) and need to fetch the add for tat account for the input file 1
4) write all the 4 datas to a single output file.

that is
output file
-----------
add x(3)
acct x(9)
amt s9(15)v9(3)
balance s9(15)v9(3)

for eg:
input file 1:
-----------
aaaaaaaaa 2345
aaaaaaaaa 1234
bbbbbbbbb 1111

input file 2:
-------------
aaaaaaaaa ABC
bbbbbbbbb BCA

input file 3:
-------------
aaaaaaaaa 1 1 0 1 0 1 1 0 1 0(10 values of balance)
bbbbbbbbb 1 1 0 1 0 1 1 0 1 0 (")

output file:
-------------
ABC aaaaaaaaa 3579 6
BCA bbbbbbbbb 1111 6

is tis possible in a single sort??

Posted: Thu Nov 15, 2007 9:08 pm
by Frank Yaeger
Since you stated in another post that you're using Syncsort, please post in the JCL Forum rather than in the DFSORT Forum. I'm moving this post to the JCL Forum.