|
|
| 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 |
|
 |
References
|
|
 |
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: 121 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 |
|
 |
arcvns
Senior Member
Joined: 17 Oct 2006 Posts: 758 Location: Chennai, India
|
|
|
|
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 |
|
 |
arcvns
Senior Member
Joined: 17 Oct 2006 Posts: 758 Location: Chennai, India
|
|
|
|
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: 121 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
Global Moderator
Joined: 14 Mar 2007 Posts: 3168 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: 121 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: 1001 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: 121 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: 121 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 |
|
 |
|
|