Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Compare two files and write only new record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
faizm

New User


Joined: 13 Apr 2012
Posts: 59
Location: India

PostPosted: Thu Jul 03, 2014 4:31 pm    Post subject: Compare two files and write only new record
Reply with quote

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
View user's profile Send private message

daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 688
Location: Pennsylvania

PostPosted: Thu Jul 03, 2014 4:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
faizm

New User


Joined: 13 Apr 2012
Posts: 59
Location: India

PostPosted: Thu Jul 03, 2014 5:03 pm    Post subject:
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 688
Location: Pennsylvania

PostPosted: Thu Jul 03, 2014 5:11 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Thu Jul 03, 2014 5:32 pm    Post subject: Reply to: Compare two files and write only new record
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts query to fetch record which has only ... maxsubrat DB2 11 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us