Input file obtained by merging 2 files
I have input file which is obtained by merging 2 files. (EACH HAVING SAY 3 REC)
The 1st four columns are as below
0001
0002
0003
0001
0002
0003
But i want the merged file to have
0001
0002
0003
0004
0005
In case we do not know the number of rec in both the input files...what can be done
[B]Question asked by visitor prabhu[/b]
Re: Input file obtained by merging 2 files
You can obtain this by XSUM
Syntax for XSUM - SUM FIELDS=NONE,XSUM in the Sort card, and a DDNAME SORTXSUM to define the file for XSUM.
XSUM should be used when you have a case where the records from input file A should be copied to file B without duplicate records, and the eliminated duplicate records should be saved in a file C. Here file C will be the file for the DD name SORTXSUM.
Example:
JCL:
Code:
//STEP010 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=TEST.XSUM.INPUT,DISP=SHR
//SORTOUT DD DSN=TEST.XSUM.OUTPUT,DISP=SHR
//SORTXSUM DD DSN=TEST.XSUM.OUTPUT.XSUM,DISP=SHR
//SYSIN DD *
SORT FIELDS=(2,10,CH,A)
SUM FIELDS=NONE,XSUM
Input file:
Code:
0001
0002
0003
0001
0002
0003
Output: Output without duplicate:
Code:
0001
0002
0003
0004
0005
Output: Duplicate records alone (XSUM File)
Code:
0001
0002
0003