Hi Billy, Typically for the first (records in B, not in A), I do the same sort of thing including A in the sortin concatenation twice, and B once, thus getting rid of all duplicate records by discarding all of A and the matches in B (based on full record length).
For the records in A with matching keys to B but different data, that seems trickier. Firstly you want to discard all the A records with unique keys by concatenating A ahead of B in sortin , and using FIRSTDUP (and keylength only) to select only the A records which match B keywise. Then a third step to take that output concatenated ahead of B, with the NODUPS option (based on full record length). Then finally concatenate the third step output with the first step output. ... at least I think that meets your new objective ... Best regards, David Tidy IS Technical Management/SAP-Mf Dow Benelux B.V. -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Bill Ashton Sent: 18 November 2014 15:20 To: [email protected] Subject: Re: Sort to show differences in a 2-file match I just realized I made a crucial mistake on the summary I sent earlier.If I followed those requirements, I would have a huge file of "mismatches" for the superset from File B. So let me restate my goal again - correctly this time! I know I can sort them in one step to fix that problem, but then I want to produce a file "C" of only the mismatches: * Records in B, not in A (only list those subset records not in the whole file) * Records in A with matching keys to B, but the data in A does not match B David, I haven't had a chance to try your job yet, but would this change things significantly? Billy On Tue, Nov 18, 2014 at 8:31 AM, Tidy, David (D) <[email protected]> wrote: > Hi, > > I have used ICETOOL with DISCARD to do that kind of thing - I think this > would give what you want in SORTOU1: > //S160SRT EXEC PGM=ICETOOL > //TOOLMSG DD SYSOUT=* > //DFSMSG DD SYSOUT=* > //SYSOUT DD SYSOUT=* > //SORTIN1 DD DSN=dataseta, > // DISP=SHR > // DD DSN=datasetb, > // DISP=OLD > //TEMPDD DD DSN=&&TEMPZ, > // DISP=(,PASS), > // SPACE=(CYL,(5,2)), > // UNIT=SYSALLDA, > // RECFM=FB, > // LRECL=2524 > //SORTOU1 DD DSN=&&DIFFS, > // DISP=(,PASS), > // SPACE=(CYL,(5,2)), > // UNIT=SYSALLDA, > // RECFM=FB, > // LRECL=2524 > //TOOLIN DD * > SELECT FROM(SORTIN1) TO(TEMPDD) DISCARD(SORTOU1) ON(1,2524,CH) ALLDUPS > //* > > Best regards, > David Tidy > IS Technical Management/SAP-Mf > Dow Benelux B.V. > > > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[email protected]] On > Behalf Of Bill Ashton > Sent: 18 November 2014 13:59 > To: [email protected] > Subject: Sort to show differences in a 2-file match > > Hi Sri et al., I have 2 files that I would like to compare, file "A" has > 50000 records, and file "B" only a subset of that - maybe 1000 records. > They have the same key (pos 1, len 24), but are not unloaded in key order. > The records are 2524 bytes long (24 byte key + 2500 bytes data). > > I know I can sort them in one step to fix that problem, but then I want to > produce a file "C" of only the mismatches: > * Records in A, not in B > * Records in B, not in A > * Records in A with matching keys to B, but the data in A does not match B > > I have done this before in CA Easytrieve, but this client does not have > that. Is there a way to do this in a SORT step? > > -- > Thank you and best regards, > *Billy Ashton* > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > -- Thank you and best regards, *Billy Ashton* ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
