Need help on SUM field



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Need help on SUM field

Postby kiran_wiproblr » Thu Apr 26, 2012 10:19 pm

Hi All,

Can some one help me please?

I am using below JCL to get sum

//STEP EXEC PGM=SORT                       
//SYSPRINT DD SYSOUT=*                     
//SYSOUT DD SYSOUT=*                       
//SORTIN DD *                             
AAAAAAA 90                                 
AAAAAAA 30                                 
AAAAAAA 40                                 
AAAAAAA 10                                 
XXXXXXX 45                                 
BBBBBBB 90                                 
TTTTTTT 80                                 
//SORTOUT DD SYSOUT=*                     
//SYSIN DD *                               
  INCLUDE COND=(1,7,CH,EQ,C'AAAAAAA')     
  SORT FIELDS=(1,7,CH,A)                   
  SUM FIELDS=(9,2,ZD)                     
/* 


Obtained output
----+----1----+----2----+----3----+----4
AAAAAAA 90
AAAAAAA 80


But My expected output has to be
----+----1----+----2----+----3----+----4
AAAAAAA 170
kiran_wiproblr
 
Posts: 21
Joined: Fri Feb 10, 2012 11:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help on SUM field

Postby BillyBoyo » Thu Apr 26, 2012 10:39 pm

There was not enough space in the field, which is only two bytes long, to hold 170. Maybe next best thing is two record records with same key which add up to that. Check in your documentation of the product.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Need help on SUM field

Postby Akatsukami » Thu Apr 26, 2012 10:40 pm

You're specifying a length of 2 for your sum field, which is overflowed by adding the second record. Change your SUM card to:
SUM FIELDS=(8,3,ZD)
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Need help on SUM field

Postby kiran_wiproblr » Thu Apr 26, 2012 11:03 pm

Hi Akatsukami

Thanks a lot it is working !!!!!!!!!
kiran_wiproblr
 
Posts: 21
Joined: Fri Feb 10, 2012 11:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help on SUM field

Postby BillyBoyo » Thu Apr 26, 2012 11:28 pm

Keep in mind that your output records are now one byte longer than they were. Better, if you want to SUM, to make your input fields long enough that the SUM won't blow them up.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post