MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
If you have DFSort utility you can do it!
In this moment I'm doing the same with DfSort with a samples by Mr Frank.
Code: |
//STEP040S EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=B
//DFSMSG DD SYSOUT=B
//IN1 DD DISP=SHR,DSN=fileA
//IN2 DD DISP=SHR,DSN=fileB
//T1 DD DSN=&&T1Y,SPACE=(CYL,(xxx,xxx),RLSE),DISP=(MOD,PASS)
//OUT11 DD DISP=(,CATLG,DELETE),LRECL=416,RECFM=FB,
// SPACE=(CYL,(xxx,xxx),RLSE),
// DSN=out11
//OUT22 DD DISP=(,CATLG,DELETE),LRECL=416,RECFM=FB,
// SPACE=(CYL,(xxx,xxx),RLSE),
// DSN=out22
//OUT12 DD DISP=(,CATLG,DELETE),LRECL=416,RECFM=FB,
// SPACE=(CYL,(xxx,xxx),RLSE),
// DSN=out12
//TOOLIN DD *
SORT FROM(IN1) TO(T1) USING(CTL1)
SORT FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT12) ON(1,416,CH) -
WITH(418,1) USING(CTL3) KEEPNODUPS
/*
//CTL1CNTL DD *
SORT FIELDS=(1,416,CH,A)
OUTFIL FNAMES=T1,OUTREC=(1,416,417:C'11')
/*
//CTL2CNTL DD *
SORT FIELDS=(1,416,CH,A)
OUTFIL FNAMES=T1,OUTREC=(1,416,417:C'22')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT11,INCLUDE=(417,2,CH,EQ,C'11'),
OUTREC=(1,416)
OUTFIL FNAMES=OUT22,INCLUDE=(417,2,CH,EQ,C'22'),
OUTREC=(1,416)
OUTFIL FNAMES=OUT12,INCLUDE=(417,2,CH,EQ,C'12'),
OUTREC=(1,416) |
In my case I have two file with many record that are 416 byte long.
With this DfSort that you can retriev in this forum searching for "Compare"
you will able to have as output:
out11 = the row that are only in file A
out22 = the row that are only in file B
out12 = the common row between file A and file B.
This only putting a qualifier at the end of each record of both file A and file B and using at the end the SPLICE command
See this part of this link:
Quote: |
Create files with matching and non-matching records (without and with duplicates) |
http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst02.html
I hope in this help... |
|