IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT output values gives me some junk number


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Tue Jul 08, 2008 4:58 pm
Reply with quote

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
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Tue Jul 08, 2008 5:39 pm
Reply with quote

Can you help please icon_sad.gif
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jul 08, 2008 5:40 pm
Reply with quote

Can you show us how the field 139,8 looks like in the input file.
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Tue Jul 08, 2008 5:54 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Jul 08, 2008 5:54 pm
Reply with quote

Hi Vijay,

I am not clear about the requirement, Can you please post here sample input and output records?

Thanks,
Arun
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Tue Jul 08, 2008 5:55 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Jul 08, 2008 6:06 pm
Reply with quote

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
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jul 08, 2008 6:08 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jul 08, 2008 6:12 pm
Reply with quote

the -381 is the .............fe83 hex
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Tue Jul 08, 2008 6:14 pm
Reply with quote

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
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jul 08, 2008 6:22 pm
Reply with quote

Thanks enrico. I was searching for the hex representation of 381 rather than -381. My bad.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Tue Jul 08, 2008 6:27 pm
Reply with quote

I beleive BI is unsiged binary, try changing to FI signed binary and doing your sum with that.
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jul 08, 2008 6:30 pm
Reply with quote

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
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Tue Jul 08, 2008 6:51 pm
Reply with quote

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
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jul 08, 2008 7:02 pm
Reply with quote

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
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Tue Jul 08, 2008 7:17 pm
Reply with quote

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
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jul 08, 2008 7:26 pm
Reply with quote

AFAIK we used FI as the field was signed. This has nothing to do with the SUM FIELDS OVERFLOW problem.
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Tue Jul 08, 2008 7:30 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Tue Jul 08, 2008 7:49 pm
Reply with quote

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
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jul 08, 2008 7:57 pm
Reply with quote

Try this in sum fields.


Code:

SUM FIELDS=(139,8,FI)
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Tue Jul 08, 2008 7:57 pm
Reply with quote

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
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jul 08, 2008 8:05 pm
Reply with quote

AFAIK you shouldn't have any problems of overflow now. Have you tested this with FI yet?
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Tue Jul 08, 2008 8:19 pm
Reply with quote

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
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Wed Jul 09, 2008 3:42 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top