Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 645
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: 645
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: 7228

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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us