View previous topic :: View next topic
|
Author |
Message |
teevijay
New User
Joined: 20 Mar 2006 Posts: 22
|
|
|
|
Guys,
i use Syncsort and when i say,
SUM FIELDS = (139,8,BI)
it says SUM FIELDS OVERFLOW.
i tried to convert it into PD and then do a SUM on it. The syntax is below -
SORT FIELDS=COPY
OUTREC FIELDS=(3,4,11,6,25,4,139,8,BI,TO=PD,LENGTH=3)
The output values gives me some junk number instead of the right ones.
Output value : 235
What i shud be getting : -385
Can you pls help me in this regard.
Thanks a ton.
Vijay |
|
Back to top |
|
|
teevijay
New User
Joined: 20 Mar 2006 Posts: 22
|
|
|
|
Can you help please |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Can you show us how the field 139,8 looks like in the input file. |
|
Back to top |
|
|
teevijay
New User
Joined: 20 Mar 2006 Posts: 22
|
|
|
|
In the Browse view:
-381
..Ç ................Úc
03640000000000FFFFFFF8
12810100010003FFFFFFE3
OUTREC FIELDS=(3,4,11,6,25,4,139,8,BI,TO=PD,LENGTH=3)
51235
----+----1----+----2---
..Ç ..........é.*.....
0364000000000052500000
1281010001000313C00000 |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Vijay,
I am not clear about the requirement, Can you please post here sample input and output records?
Thanks,
Arun |
|
Back to top |
|
|
teevijay
New User
Joined: 20 Mar 2006 Posts: 22
|
|
|
|
In the Browse view:
INPUT file
-----------
-381
..Ç ................Úc
03640000000000FFFFFFF8
12810100010003FFFFFFE3
after OUTREC FIELDS=(3,4,11,6,25,4,139,8,BI,TO=PD,LENGTH=3)
OUTPUT file
---------------
51235
----+----1----+----2---
..Ç ..........é.*.....
0364000000000052500000
1281010001000313C00000
Hope this is clear. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Vijay,
I dont find much difference between your last two posts.
What is your requirement.? what is the LRECL of the input file? what is its layout? How do you want your output to be?
Thanks,
Arun |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Can you post the input file with the column numbers or just post how -381 is stored in it. I couldn't make it out from your post. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
the -381 is the .............fe83 hex |
|
Back to top |
|
|
teevijay
New User
Joined: 20 Mar 2006 Posts: 22
|
|
|
|
Hey Arun,
My requirement is simple or generic.
I have a file with over 18 M records, where am sorting per Dept and summing up on a field - Quantity.
Qty is a binary field S9(18) COMP.
when i do a SUM on it...it says SUM FIELDS OVERFLOW.
Since, 8 is the maximum we can have for BI in sort/sum, i would like to do some thing to overcome that OVERFLOW problem.
Hence i thought i will convert it into PD and then do a SUM on it.
and when i did - using TO=PD, my output Quantity is entirely different.
Hence seeking help to correct my syntax.
Thanks,
Vijay |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Thanks enrico. I was searching for the hex representation of 381 rather than -381. My bad. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
I beleive BI is unsiged binary, try changing to FI signed binary and doing your sum with that. |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Craq,
You just beat me by few minutes. I was just testing out the FI part.
Vijay,
Try this
Code: |
OUTREC BUILD=(1,8,FI,EDIT=(STTTTTTT),SIGNS=(+,-)) |
You can change the EDIT field according to your requirements. |
|
Back to top |
|
|
teevijay
New User
Joined: 20 Mar 2006 Posts: 22
|
|
|
|
Thanks Manu,
i just gave this as a test
SORT FIELDS=COPY,STOPAFT=10
OUTREC BUILD=(139,8,FI,EDIT=(STTTTTTTTTTTTTTTTTT),SIGNS=(,-))
SUM FIELDS=(139,8)
just as a clarification, is the above thing correct !? |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
not sure if you can combine the outrec build and sum fields in the same step. When i tried it completed successfully but didn't sum the fields. |
|
Back to top |
|
|
teevijay
New User
Joined: 20 Mar 2006 Posts: 22
|
|
|
|
One more clarification,
Do i really need to convert a BI field to FI to avoid a SUM FIELDS OVERFLOW ?
Thanks,
Vijay |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
AFAIK we used FI as the field was signed. This has nothing to do with the SUM FIELDS OVERFLOW problem. |
|
Back to top |
|
|
teevijay
New User
Joined: 20 Mar 2006 Posts: 22
|
|
|
|
Then it doesnt solve my problem.
Pls let me know, how to overcome a SUM FIELDS OVERFLOW for a BI field
Solution could be to convert it into a PD field and then do a SUM on it.
---> How do i do it ?
Any other solutions ?
Thanks.
Vijay |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
teevijay wrote: |
Then it doesnt solve my problem.
Pls let me know, how to overcome a SUM FIELDS OVERFLOW for a BI field
Solution could be to convert it into a PD field and then do a SUM on it.
---> How do i do it ?
Any other solutions ?
Thanks.
Vijay |
1. IT IS NOT A BI FIELD it is an FI field.
2. When you use a signed binary field that is negative (even a small value) as an unsigned field it will be treated as a very large number. |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Try this in sum fields.
Code: |
SUM FIELDS=(139,8,FI) |
|
|
Back to top |
|
|
teevijay
New User
Joined: 20 Mar 2006 Posts: 22
|
|
|
|
Craq,
you mean to say that instead of using BI, i should use FI ?
SUM FIELDS = (139,8,FI) would do to eliminate the overflow ?
Thanks,Vijay |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
AFAIK you shouldn't have any problems of overflow now. Have you tested this with FI yet? |
|
Back to top |
|
|
teevijay
New User
Joined: 20 Mar 2006 Posts: 22
|
|
|
|
Thanks Craq and Manu.
I have tested for few sample records and now running it for the entire file of over 20 M records.
Wll keep you posted about the results.
Thanks again.
Vijay |
|
Back to top |
|
|
Vasukip Currently Banned New User
Joined: 17 Jun 2008 Posts: 48 Location: Chennai
|
|
|
|
teevijay wrote: |
Thanks Manu,
i just gave this as a test
SORT FIELDS=COPY,STOPAFT=10
OUTREC BUILD=(139,8,FI,EDIT=(STTTTTTTTTTTTTTTTTT),SIGNS=(,-))
SUM FIELDS=(139,8)
just as a clarification, is the above thing correct !? |
Hi,
here in SUM FIELDS statement you gotta give format Type i.e BI or ZD
SUM FIELDS=(139,8,BI) or SUM FIELDS=(139,8,ZD) |
|
Back to top |
|
|
|