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: 683
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: 683
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: 7315

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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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