View previous topic :: View next topic
|
Author |
Message |
faizm
New User
Joined: 13 Apr 2012 Posts: 59 Location: India
|
|
|
|
Hi,
I have two files of same LRECL. First position in both the files is space. I have to compare two files and write only those records that are new records present in second file and not the updated ones. Also, I need to insert 'D' at first position for all the additional records. Note: there are no key common to both these files.
Example
File 1:
11111AAAA
11111BBBB
File 2:
11111AAAA
11111BBCC
22222CCCC
Output should contain only
D22222CCCC
I am using UNPAIRED,F2,ONLY in JOINKEYS but it gives me the updated records as well. However I just need if there are any additional records in the file.
Please help me out. Thanks |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
These two statements contradict each other.
Quote: |
Note: there are no key common to both these files.
but it gives me the updated records as well. |
If there is no key, and you are using the entire record for your sort/join, then the second record on file 2 is a NEW record.
If you were to Join columns 1,6 then it would solve the issue for the data presented. |
|
Back to top |
|
|
faizm
New User
Joined: 13 Apr 2012 Posts: 59 Location: India
|
|
|
|
Hi Dave,
Yes in this case second record will be new record but since some of its character matches with the previous file at same position hence I would not want this in the output file.
I am using the entire record for sort/join and this results in the second record coming in output file along with the third record. My requirement in this example to get the 3rd record only in output.
Thanks. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
From what I know, Joinkeys is not able to deal with:
Quote: |
some of its character matches with the previous file at same position hence I would not want this in the output file. |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Can you provide better sample data? You either have a key or you don't. If you don't, don't make it look like you have.
What might your input files look like if you had three records on your output? |
|
Back to top |
|
|
|