I'm having a problem with using XSUM in a sort routine, until today (at least a year) this sort has worked just perfectly, and then today seemed to start giving "random" results as to which record it was eliminating.
Essentially the Key to my file is a 16 character field at position 26
I'm sorting two files together using this
//*-------------------------------------------------------------------
//* NOW SORT THE ACH INTO IT
//*-------------------------------------------------------------------
//S020 EXEC PGM=SORT
//SORTWK01 DD SPACE=(CYL,1000)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//$ORTPARM DD DISP=SHR,DSN=TCTAA.CNVTKIT.SYSIN(GIN1001A)
//SORTIN DD DISP=SHR,DSN=KCTAA.COC.BKP.CPOL.OUTPUT(0)
// DD DISP=SHR,DSN=TCTAA.COC.ACHTEST
//SORTOUT DD DISP=(NEW,CATLG),DSN=TCTAA.TKIT.J129S010.CNC300S(+1),
// SPACE=(CYL,(10,10),RLSE),
// VOL=(,,,40)
//SYSIN DD *
SORT FIELDS=(26,16,CH,A,
42,4,CH,A,
46,4,CH,A,
19,4,CH,A,
69,5,CH,A,
50,4,CH,A)
//* NOW SORT THE ACH INTO IT
//*-------------------------------------------------------------------
//S020 EXEC PGM=SORT
//SORTWK01 DD SPACE=(CYL,1000)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//$ORTPARM DD DISP=SHR,DSN=TCTAA.CNVTKIT.SYSIN(GIN1001A)
//SORTIN DD DISP=SHR,DSN=KCTAA.COC.BKP.CPOL.OUTPUT(0)
// DD DISP=SHR,DSN=TCTAA.COC.ACHTEST
//SORTOUT DD DISP=(NEW,CATLG),DSN=TCTAA.TKIT.J129S010.CNC300S(+1),
// SPACE=(CYL,(10,10),RLSE),
// VOL=(,,,40)
//SYSIN DD *
SORT FIELDS=(26,16,CH,A,
42,4,CH,A,
46,4,CH,A,
19,4,CH,A,
69,5,CH,A,
50,4,CH,A)
As you can see, it sorts with the various sort fields, this always ends up with the record I am interested in is first, and the record I want elimited as a duplicate is second (verified repeatedly in file output)
For the XSUM part I'm using
//*-------------------------------------------------------------------
//* NOW SORT THAT ELIMINATING DUPLICATES (BASED ON POLICY NUMBER)
//*-------------------------------------------------------------------
//S030 EXEC PGM=SORT
//SORTWK01 DD SPACE=(CYL,1000)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//$ORTPARM DD DISP=SHR,DSN=TCTAA.CNVTKIT.SYSIN(GIN1001A)
//SORTIN DD DISP=SHR,DSN=*.S020.SORTOUT
//SORTOUT DD DISP=(NEW,CATLG),DSN=TCTAA.TKIT.J129S010.CNC300S(+2),
// SPACE=(CYL,(10,10),RLSE),
// VOL=(,,,40)
//SORTXSUM DD DISP=(NEW,CATLG),DSN=TCTAA.TKIT.J129S010.CNC300S(+3),
// SPACE=(CYL,(10,10),RLSE),
// VOL=(,,,40)
//SYSIN DD *
SUM FIELDS=NONE,XSUM
SORT FIELDS=(26,16,CH,A)
//*-------------------------------------------------------------------
//* NOW SORT THAT ELIMINATING DUPLICATES (BASED ON POLICY NUMBER)
//*-------------------------------------------------------------------
//S030 EXEC PGM=SORT
//SORTWK01 DD SPACE=(CYL,1000)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//$ORTPARM DD DISP=SHR,DSN=TCTAA.CNVTKIT.SYSIN(GIN1001A)
//SORTIN DD DISP=SHR,DSN=*.S020.SORTOUT
//SORTOUT DD DISP=(NEW,CATLG),DSN=TCTAA.TKIT.J129S010.CNC300S(+2),
// SPACE=(CYL,(10,10),RLSE),
// VOL=(,,,40)
//SORTXSUM DD DISP=(NEW,CATLG),DSN=TCTAA.TKIT.J129S010.CNC300S(+3),
// SPACE=(CYL,(10,10),RLSE),
// VOL=(,,,40)
//SYSIN DD *
SUM FIELDS=NONE,XSUM
SORT FIELDS=(26,16,CH,A)
//*-------------------------------------------------------------------
Which I believe should always eliminate the second record, and yet, sometimes it's eliminating the first record?
Anyone have any ideas?