View previous topic :: View next topic
|
Author |
Message |
kalukakkad
New User
Joined: 10 Mar 2005 Posts: 81
|
|
|
|
i have 2 files with same key fields. I need to ensure that the keys in File-1 occur atleast once in File-2. Both the files can have duplicates.
File-1
ABCD1234
ABCD1234
ABCD1234
RTYG7890
File-2
ABCD1234
ABCD1234
File-2 does not have RTYG7890, i need to report this.
Can this be done in DFSORT? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
What is the RECFM and LRECL of the input file? For your example, would you just want the RTYG7890 record in the output file? What would you want for output if input file1 had:
ABCD1234
ABCD1234
ABCD1234
RTYG7890
Q1234567
Q1234567 |
|
Back to top |
|
|
kalukakkad
New User
Joined: 10 Mar 2005 Posts: 81
|
|
|
|
If my input file had
ABCD1234
ABCD1234
ABCD1234
RTYG7890
Q1234567
Q1234567
My output file should have - a single occurance for each missing record
RTYG7890
Q1234567
RECFM=FB and LRECL=80 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job tha will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/80)
//IN2 DD DSN=... input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/80)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,8,CH) -
KEEPNODUPS 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'BB'),
BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
kalukakkad
New User
Joined: 10 Mar 2005 Posts: 81
|
|
|
|
Thanks Frank... |
|
Back to top |
|
|
|