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

After SUM FIELDS, i am still getting duplicates


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: Fri Jul 04, 2008 2:50 pm
Reply with quote

Hi Guys,
I am using a sort to sum up the Units and Amounts per Dept, Class Item and Location-id. when i do this,i still find few records(duplicates) creeping in instead of summing up. If i use the SUM FIELDS=NONE, using the same keys, they are getting eliminated(getting unique records per Dept,class,item,loc)

SORT FIELDS=(Dept,Class,Item,Location-id)
SUM FIELDS=(21,4,BI,25,4,BI)

//*they are not being summed up.Atleast one record is being left out *//

Kindly Help. Many thanks in advance.
Vijay
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jul 04, 2008 3:09 pm
Reply with quote

teevijay

when u mention
SUM FIELDS=(21,4,BI,25,4,BI)

check if the sum total is exceeding the length 4, if so the SORT will wont sum those records!!
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Fri Jul 04, 2008 3:17 pm
Reply with quote

No KrisPrems,
The Units and Amount Numbers are very small Eg : 1.25 Etc
More over its actually (Sorry for my mistake)

SUM FIELDS=(14,8,BI,22,8,BI)

Hence it should not be a problem i guess.

Thanks.
Vijay
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jul 04, 2008 4:52 pm
Reply with quote

check the below example at adjust asper ur need...
Code:
//****************************************************
//S1       EXEC  PGM=ICEMAN                           
//SYSOUT   DD  SYSOUT=*                               
//SORTIN   DD *                                       
123  M  CS 64858                                     
234  D  DB 45645                                     
434  D  CS 64858                                     
/*                                                   
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD    *                                   
  SORT FIELDS=(9,2,CH,A)                             
  OUTFIL NODETAIL,                                   
    SECTIONS=(9,2,                                   
      TRAILER3=(1,11,12:TOT=(12,5,ZD,EDIT=(TTTTTT))))
/*                                                   


If this still doesnt work out, u need to show the sample i/p and your SYSOUT details as well.
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Fri Jul 04, 2008 5:07 pm
Reply with quote

Here is what i try to do.
Instead of getting a unique record with summed up values, i am still left with Dup records for few Dept-Class-Item-Loc

//STEP05 EXEC SORTD
//SORTIN DD DSN=TEST.EXTRACT.SRT.IN,DISP=SHR
//SORTOUT DD DSN=TEST.EXTRACT.SRT.SUM,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(800,200),RLSE),
// DCB=*.SORTIN
//SYSIN DD *
SORT FIELDS=(1,4,BI,A,5,2,BI,A,7,2,BI,A,9,2,BI,A,11,2,BI,A)
SUM FIELDS=(14,8,BI,22,8,BI)
/*

Hope this helps.
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Fri Jul 04, 2008 5:07 pm
Reply with quote

Here is what i try to do.
Instead of getting a unique record with summed up values, i am still left with Dup records for few Dept-Class-Item-Loc

//STEP05 EXEC SORTD
//SORTIN DD DSN=TEST.EXTRACT.SRT.IN,DISP=SHR
//SORTOUT DD DSN=TEST.EXTRACT.SRT.SUM,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(800,200),RLSE),
// DCB=*.SORTIN
//SYSIN DD *
SORT FIELDS=(1,4,BI,A,5,2,BI,A,7,2,BI,A,9,2,BI,A,11,2,BI,A)
SUM FIELDS=(14,8,BI,22,8,BI)
/*

Hope this helps.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jul 04, 2008 5:19 pm
Reply with quote

Quote:
If this still doesnt work out, u need to show the sample i/p and your SYSOUT details as well.


i want the SYSOUT details as well as the sample i/p and op that u r expecting and sample o/p that u r getting!!
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Fri Jul 04, 2008 5:30 pm
Reply with quote

Here it is...

SORT FIELDS=(1,4,BI,A,5,2,BI,A,7,2,BI,A,9,2,BI,A,11,2,BI,A)
SUM FIELDS=(14,8,BI,22,8,BI)
WER276B SYSDIAG= 865757, 1022951, 1022951, 1347768
WER164B 24,612K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 24,564K BYTES USED
WER146B 12K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 29; BLKSIZE= 27985
WER110I SORTOUT : RECFM=FB ; LRECL= 29; BLKSIZE= 27985
WER410B 23,584K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 23,584K BYTES USED
WER036B G=490220,B=1835,BIAS=98
WER045C END SORT PHASE
WER055I INSERT 0, DELETE 0
WER418I DATASPACE(S) AND/OR ZSPACE USED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER049I SUM FIELD OVERFLOW
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B SORTIN : EXCP'S=34,UNIT=3390,DEV=D410,CHP=(8191829283938494,2),VOL=T
WER416B SORTOUT : EXCP'S=156,UNIT=3390,DEV=D417,CHP=(8191829283938494,2),VOL=
WER416B TOTAL OF 190 EXCP'S ISSUED FOR SORTING
WER246I FILESIZE 476,622,772 BYTES
WER054I RCD IN 16435268, OUT 16435268
WER072I NOEQUALS IN EFFECT
WER169I RELEASE 1.2 BATCH 0427 TPF LEVEL .3
WER052I END SYNCSORT - A5104874,STEP05,SORT,DIAG=FD00,FBC5,C03B,285D,A5D7,49CA
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jul 04, 2008 5:56 pm
Reply with quote

thanks for posting the spool details...
1. WER**** shows that u r using SYNCSORT not DFSORT( so you should have posted your question in JCL forum rather than DFSORT forum)
2. you need to provide
Quote:
the sample i/p and op that u r expecting and sample o/p that u r getting
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Fri Jul 04, 2008 6:56 pm
Reply with quote

Thanks Krisprems,
i think i found the problem.

Quote:
WER049I SUM FIELD OVERFLOW


Regards,
Vijay
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 How to remove block of duplicates DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts Converting unpacked fields to pack us... SYNCSORT 4
Search our Forums:

Back to Top