View previous topic :: View next topic
|
Author |
Message |
nivethitha_kumar
New User
Joined: 24 Jan 2007 Posts: 11 Location: chennai
|
|
|
|
hi
i have two input files
file A
--------
aaaa1111
bbbb2222
cccc3333
aaaa2222
dddd4444
file B
------
cccc4444
fffff55555
gggg6666
i need to compare the files on the first 4 fields alone and need to get all the records tht are present in file A alone...
ie my output should be
output
-------
aaaa1111
bbbb2222
aaaa2222
dddd4444
i do not need cccc3333 as it matches with the first 4 fields of file2 's record cccc
Also like i have pointed out i need to have any duplicates in fileA in my output too... the records tht do not ahve any match in file B... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. The output records will be in order by key. If you want the output records in the original input record order, we'd need to change the job to add a sequence number and sort on it. Let me know if you need me to show you how to do that.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
aaaa1111
bbbb2222
cccc3333
aaaa2222
dddd4444
/*
//IN2 DD *
cccc4444
fffff55555
gggg6666
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,4,CH) -
KEEPNODUPS KEEPBASE -
WITHALL WITH(1,81) USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(81:C'BB')
/*
//CTL2CNTL DD *
INREC OVERLAY=(81:C'VV')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,EQ,C'VV'),
BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
nivethitha_kumar
New User
Joined: 24 Jan 2007 Posts: 11 Location: chennai
|
|
|
|
Thank you so much...also i checked out the sorttrck pdf .. are all the syntaxes and functions compatible with ice tool too? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
also i checked out the sorttrck pdf .. are all the syntaxes and functions compatible with ice tool too? |
I don't know what you mean by this. My "Smart DFSORT Tricks" paper shows "tricks" that use functions available with DFSORT and DFSORT's ICETOOL.
If that doesn't answer your question, then please clarify what it is you're asking. |
|
Back to top |
|
|
|