JAYANT KUMAR SAHOO
New User
Joined: 15 Mar 2006 Posts: 14
|
|
|
|
hi ,
i have a huge file containing millions of records.i want a sum of a particular numeric field for all the records.I am using syncsort and using
TRAILER1=(1:TOT=(2,11,ZD,M11,LENGTH=15))
BUT as syncsort only allow upto max lenght 15 i am not able to get the sum as my output is a 20digit no.
I know that in dfsort we can overcome this as dfsort has max lenght upto 31.
But I cant use dfsort.If somebody can give me a jcl code whcih can achieve this with syncsort,I will be greatful to him/her. |
|
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
Hi,
if at all you want to achieve this using SYNCSORT try appending a string at the end of the record say
u have a records like
111111111 11111 2222
222222222 22222 3333
make it as
111111111 11111 2222 aaaaaaa
222222222 22222 3333 aaaaaaa
Now use a sort fields as the last string and the SUM FIELD as ur amount field here is the sort card for the above record having length 20
sort fields=(22,7,ch,a)
inrec field=(1,21,c'aaaaaaa')
sum fields=(11,5,zd)
outrec fields=(1,22)
The result would be 111111111 33333 2222
Hope this might be useful
Regards, |
|