View previous topic :: View next topic
|
Author |
Message |
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
The requirement is to compare file1 with file2. Records in file2 also occur in file1. Output file3 should contain records in file1 that do not exist in file2.
Duplicate records may exist within each file and that is ok.
Record length = 138 and it is fixed block.
file1 (lrecl = 138)
test1aaa
test1bbb
test1bbb
test1ccc
test1ddd
----------------------------------------
file2 (lrecl = 138)
test1aaa
test1bbb
test1bbb
--------------------------------------
output file3 (lrecl=138) should contain
test1ccc
test1ddd |
|
Back to top |
|
|
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
....one more thing, there are no key values in the file, the comparison is to be made over the entire record length of 138. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Suresh,
Suppose file-1 has duplicate records which are not present in file-2.
Do you want all those duplicate records into your output file?
Thanks,
Arun |
|
Back to top |
|
|
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
Arun, yes, if file-1 has duplicate records that are not present in file-2, then those records are also required in the output file.
thanks. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
ssk,
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/138)
//IN2 DD DSN=... input file2 (FB/138)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/138)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,138,CH) -
KEEPBASE KEEPNODUPS WITHALL WITH(1,139) USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(139:C'BB')
/*
//CTL2CNTL DD *
INREC OVERLAY=(139:C'VV')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(139,2,CH,EQ,C'VV'),
BUILD=(1,138)
/*
|
|
|
Back to top |
|
|
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
Thanks Frank, it works !! |
|
Back to top |
|
|
|