View previous topic :: View next topic
|
Author |
Message |
friend
New User
Joined: 01 Dec 2005 Posts: 3
|
|
|
|
Hi.
I want to find identical records out of 2 files, and save result.
Each of these 2 files has a common key with different format :
Inputfile1 (I1) key is a 6 positions numeric (eq Pic 9(6))
Inputfile2 (I2) key is a 4 positions hexadecimal
how can i compare those 2 keys, match records and save result ?
Thanks for your help.
Regards. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Please show an example of the input records in each file, and what you expect the output records to look like. Can input file1 have duplicates? Can input file2 have duplicates? What is the RECFM and LRECL of each file? |
|
Back to top |
|
|
friend
New User
Joined: 01 Dec 2005 Posts: 3
|
|
|
|
input file 1 (I1) :
VB LRECL=37
key is made of 2 fields (absolute position given) :
pos 28 Len=4 type CH
pos 32 Len=6 type NUM
input file 2 (I2) :
VB LRECL=4100
key is made of 2 fields (absolute position given) :
pos 05 Len=4 type CH
pos 32 Len=4 type HEX
for each record of I1, I want to select all corresponding records of I2
I1
20051130.{ ?Gd.LOBJOISECRD000698
I2
ECRD...?.......?
CCDC000B00000205
5394002A60005002
I hope it is clear enough, thanks for helping
JFR |
|
Back to top |
|
|
friend
New User
Joined: 01 Dec 2005 Posts: 3
|
|
|
|
i forgot to mention that both file are of course sorted on their key :
I1 doesn't have no duplicates
I2 can have duplicates |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I can't match up the keys you describe with the input data you show. What do you mean by NUM (ZD? Something else)? What do you mean by HEX (BI? Something else?).
This will probably go faster for both of us if you show me what the actual data in the first few records of each file looks like, so run this job and post the OUT1 and OUT2 output, or send it to me offline (yaeger@us.ibm.com):
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (VB/37)
//IN2 DD DSN=... input file2 (VB/4100)
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(OUT1) USING(CTL1)
COPY FROM(IN2) TO(OUT2) USING(CTL1)
/*
//CTL1CNTL DD *
OPTION STOPAFT=3
OUTREC FIELDS=(1,4,1,4,HEX,5,HEX)
/*
|
Also, you say the second key in file1 has a different length and format than the second key in file2 (6,NUM vs 4,HEX), so it's unclear how you would want to compare them. Please explain (preferably with examples). |
|
Back to top |
|
|
|