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

Merging 2 datasets into one


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

New User


Joined: 09 Feb 2023
Posts: 1
Location: Italy

PostPosted: Fri Feb 10, 2023 2:06 pm
Reply with quote

Hello, I state that I do not speak English well, I have 2 input datasets that have the same first field, I should merge the 2 datasets into a single one and align the records based on the first field, remove the duplicates from the first field due to the second field and put the doubles of the second field all on one line separated by the '-' character. For example:

Code:

FILE IN 1:
AAAAAAAA   AA     XXXXX    XXXXX
AAAAAAAA   TT     XXXXX    XXXXX
AAAAAAAA   YY     XXXXX    XXXXX
BBBBBBBB   BB     QQQQQ    QQQQQ
CCCCCCCC   CC     RRRRR    RRRRR
CCCCCCCC   II     RRRRR    RRRRR
CCCCCCCC   OO     RRRRR    RRRRR
DDDDDDDD   DD     YYYYY    YYYYY
EEEEEEEE   EE     MMMMM    MMMMM
FFFFFFFF   FF     UUUUU    UUUUU


FILE IN 2:
AAAAAAAA   WWWWWW    TTTTTTT
CCCCCCCC   OOOOOO    IIIIIII
EEEEEEEE   ZZZZZZ    NNNNNNN
FFFFFFFF   KKKKKK    LLLLLLL


FILE OUTPUT:
AAAAAAAA   AA-TT-YY     XXXXX    XXXXX     WWWWWW    TTTTTTT
BBBBBBBB   BB           QQQQQ    QQQQQ
CCCCCCCC   CC-II-OO     RRRRR    RRRRR     OOOOOO    IIIIIII
DDDDDDDD   DD           YYYYY    YYYYY
EEEEEEEE   EE           MMMMM    MMMMM     ZZZZZZ    NNNNNNN
FFFFFFFF   FF           UUUUU    UUUUU     KKKKKK    LLLLLLL


Could you help me with this case?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2022
Location: USA

PostPosted: Fri Feb 10, 2023 6:19 pm
Reply with quote

There are tons of ways to do this merge.

The simplest method is - using the DFSORT/SYNCSORT tool (provided the maximum number of records in a single group is reasonably limited).

Try to read something about it. There are hundreds, or thousands of working examples at this forum, and around.

Try to achieve your goal step by step, not "everything at once":
    - learn how to handle duplicate records,
    - learn how to reformat the output records,
    - learn how to join two input streams,
    - learn how to combine all those tricks together.
P.S.
Using SORT facility is not related in any manner to the use of JCL features.
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 PL/I, VB Datasets and the RDW PL/I & Assembler 4
No new posts how to get list of all VSAM/non-VSAM ... JCL & VSAM 13
No new posts define 1 DCB parms for multiple outpu... JCL & VSAM 9
No new posts FTP datasets to server CLIST & REXX 13
No new posts Merging 2 files but ignore duplicate... DFSORT/ICETOOL 1
Search our Forums:

Back to Top