# SYNCSORT output values gives me some junk number

Author Message
teevijay

New User

Joined: 20 Mar 2006
Posts: 22

 Posted: Tue Jul 08, 2008 4:58 pm 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
teevijay

New User

Joined: 20 Mar 2006
Posts: 22

 Posted: Tue Jul 08, 2008 5:39 pm Can you help please
Manuneedhi K

Active User

Joined: 07 May 2008
Posts: 115
Location: Chennai

 Posted: Tue Jul 08, 2008 5:40 pm Can you show us how the field 139,8 looks like in the input file.
teevijay

New User

Joined: 20 Mar 2006
Posts: 22

 Posted: Tue Jul 08, 2008 5:54 pm 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
Arun Raj

Moderator

Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

 Posted: Tue Jul 08, 2008 5:54 pm Hi Vijay, I am not clear about the requirement, Can you please post here sample input and output records? Thanks, Arun
teevijay

New User

Joined: 20 Mar 2006
Posts: 22

 Posted: Tue Jul 08, 2008 5:55 pm 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.
Arun Raj

Moderator

Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

 Posted: Tue Jul 08, 2008 6:06 pm 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
Manuneedhi K

Active User

Joined: 07 May 2008
Posts: 115
Location: Chennai

 Posted: Tue Jul 08, 2008 6:08 pm 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.
enrico-sorichetti

Superior Member

Joined: 14 Mar 2007
Posts: 10833
Location: italy

 Posted: Tue Jul 08, 2008 6:12 pm the -381 is the .............fe83 hex
teevijay

New User

Joined: 20 Mar 2006
Posts: 22

 Posted: Tue Jul 08, 2008 6:14 pm 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
Manuneedhi K

Active User

Joined: 07 May 2008
Posts: 115
Location: Chennai

 Posted: Tue Jul 08, 2008 6:22 pm Thanks enrico. I was searching for the hex representation of 381 rather than -381. My bad.
Craq Giegerich

Senior Member

Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

 Posted: Tue Jul 08, 2008 6:27 pm I beleive BI is unsiged binary, try changing to FI signed binary and doing your sum with that.
Manuneedhi K

Active User

Joined: 07 May 2008
Posts: 115
Location: Chennai

Posted: Tue Jul 08, 2008 6:30 pm

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.
teevijay

New User

Joined: 20 Mar 2006
Posts: 22

 Posted: Tue Jul 08, 2008 6:51 pm 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 !?
Manuneedhi K

Active User

Joined: 07 May 2008
Posts: 115
Location: Chennai

 Posted: Tue Jul 08, 2008 7:02 pm 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.
teevijay

New User

Joined: 20 Mar 2006
Posts: 22

 Posted: Tue Jul 08, 2008 7:17 pm One more clarification, Do i really need to convert a BI field to FI to avoid a SUM FIELDS OVERFLOW ? Thanks, Vijay
Manuneedhi K

Active User

Joined: 07 May 2008
Posts: 115
Location: Chennai

 Posted: Tue Jul 08, 2008 7:26 pm AFAIK we used FI as the field was signed. This has nothing to do with the SUM FIELDS OVERFLOW problem.
teevijay

New User

Joined: 20 Mar 2006
Posts: 22

 Posted: Tue Jul 08, 2008 7:30 pm 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
Craq Giegerich

Senior Member

Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

Posted: Tue Jul 08, 2008 7:49 pm

 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.
Manuneedhi K

Active User

Joined: 07 May 2008
Posts: 115
Location: Chennai

Posted: Tue Jul 08, 2008 7:57 pm

Try this in sum fields.

 Code: SUM FIELDS=(139,8,FI)
teevijay

New User

Joined: 20 Mar 2006
Posts: 22

 Posted: Tue Jul 08, 2008 7:57 pm 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
Manuneedhi K

Active User

Joined: 07 May 2008
Posts: 115
Location: Chennai

 Posted: Tue Jul 08, 2008 8:05 pm AFAIK you shouldn't have any problems of overflow now. Have you tested this with FI yet?
teevijay

New User

Joined: 20 Mar 2006
Posts: 22

 Posted: Tue Jul 08, 2008 8:19 pm 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
Vasukip
Currently Banned

New User

Joined: 17 Jun 2008
Posts: 48
Location: Chennai

Posted: Wed Jul 09, 2008 3:42 pm

 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)
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2 Jes2 command output All Other Mainframe Topics 4 COBOL Ascending and descending sort n... COBOL Programming 5 Count the number of characters in a f... CA Products 1 Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
Search our Forums:

 IBMMainframes.com is not an official and/or affiliated with IBM® in anyway Board Rules | FAQ | Downloads | Wiki | SiteMap | Contact Us