|
|
| Author |
Message |
bsurent
New User
Joined: 26 Aug 2005 Posts: 2 Location: chennai
|
|
|
|
1) file A contains 10 records
2) file B contains 15 records
Most of the records in both files are common.
Report records in File B that doesn?t appear in file A |
|
| Back to top |
|
 |
References
|
|
 |
priyesh.agrawal
Global Moderator
Joined: 28 Mar 2005 Posts: 1509 Location: Chicago, IL
|
|
|
|
Hi bsurent,
I think you'll have to make a program logic for that.
You can go thru the link below, which should give you a skeleton, but not the excat logic.
Regards,
Priyesh. |
|
| Back to top |
|
 |
priyesh.agrawal
Global Moderator
Joined: 28 Mar 2005 Posts: 1509 Location: Chicago, IL
|
|
| Back to top |
|
 |
Alain Benveniste
Active User
Joined: 14 Feb 2005 Posts: 90
|
|
|
|
Bsurent,
What are you trying to do ? It's not clear for me.
Alain |
|
| Back to top |
|
 |
MGIndaco
Moderator
Joined: 10 Mar 2005 Posts: 478 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... |
|
| Back to top |
|
 |
|
|
|