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

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top