View previous topic :: View next topic
Author
Message
teevijay New User Joined: 20 Mar 2006Posts: 22
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
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
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
teevijay New User Joined: 20 Mar 2006Posts: 22
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
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
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
teevijay New User Joined: 20 Mar 2006Posts: 22
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
teevijay New User Joined: 20 Mar 2006Posts: 22
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
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
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
teevijay New User Joined: 20 Mar 2006Posts: 22
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
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
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
teevijay New User Joined: 20 Mar 2006Posts: 22
Thanks Krisprems,
i think i found the problem.
Quote:
WER049I SUM FIELD OVERFLOW
Regards,
Vijay
Back to top
Please enable JavaScript!