IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Merging 2 files but ignore duplicates from 2nd file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
SUJEET06462

New User


Joined: 20 Sep 2016
Posts: 2
Location: India

PostPosted: Sun Jun 06, 2021 1:51 am
Reply with quote

Quote:

I HAVE 2 FILES BOTH HAVING SAME LRECL OF 14
BOTH THE FILES ARE NOT IN SORTED ORDER FOR ITS KEY.
KEY IS 1: 5 FOR BOTH FILES
I WANT TO MERGE BOTH THE FILES INTO OUTPUT DATA SET.
IF THERE IS ANY DUPLICATE BETWEEN FILE1 AND FILE2, RECORD IN FILE1 ONLY SHOULD BE COPIED TO OUTPUT FILE.
FILE 1 : SALARY OF EPMPLOYEE IN JUNE
EMP01 HR 20000
EMP02 IT 40000
EMP03 SS 25000
EMP04 HR 45000

FILE2: SALARY OF EMPLOYEE IN MAY
EMP04 HR 40000
EMP05 IT 12000
EMP06 KK 15000

OUTPUT FILE : AFTER MERGING AND REMOVING DULPICATES FROM FILE2:
EMP01 HR 20000
EMP02 IT 40000
EMP03 SS 25000
EMP04 HR 45000
EMP05 IT 12000
EMP06 KK 15000

[/code]

SORT FIELDS = (1,5,CH,A)
SUM FILEDS = NONE
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1140

PostPosted: Sun Jun 06, 2021 2:27 am
Reply with quote

0) Learn how to use properly the code tags.

1) Learn how to use properly UPPERCASE, lower case, and Mixed Case in ANY of your messages and/or codes. Same about bold, and italic.

2) Learn the difference between MERGE operations, and JOIN operations.

3) Next, you are ready to start questioning about code development.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To pull the file with Date and Time u... TSO/ISPF 16
No new posts regarding COBOL WRITE verb (VB File H... COBOL Programming 6
No new posts COBOL Table data to a flat file with ... COBOL Programming 8
No new posts Compare 2 files replace data in 1st f... DFSORT/ICETOOL 4
No new posts DB2 SQL query to read and update data... DB2 12
Search our Forums:

Back to Top