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
 

 

Match and Merge Two Files with both having duplicate records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sarbamrit

New User


Joined: 15 Oct 2007
Posts: 12
Location: Kentucky

PostPosted: Wed Oct 17, 2007 7:22 am    Post subject: Match and Merge Two Files with both having duplicate records
Reply with quote

Hi,

I'm having 2 Files IN1 and IN2.
Both files has 2 keys on which match and merge needs to be done
For IN1 - Key Position K1 starts from 8 with length 7 and 2nd key K2 starts from 15 with length of 4.
For IN2 - 1st Key K1 starts from Position 1 with length of 7. 2nd Key K2 starts from 8th Position with length of 4.

Both IN1 and IN2 can have duplicates based on K1 and K2.
Need to keep all records of IN1

IN1 Records
000000100000010001ABC
000000100000010001DEF
000000100000020001ABC
000000100000030004ABC
000000100000040001ABC
000000100000050001ABC
000000100000050001EFG
000000100000050001HIJ

IN2 Records
00000010001X12
00000010001X22
00000030004XYZ
00000030004X1Z
00000050001RST
00000050001XYZ

Output should be
000000100000010001ABCX12
000000100000010001ABCX22
000000100000010001DEFX12
000000100000010001DEFX22
000000100000020001ABC
000000100000030004ABCXYZ
000000100000030004ABCX1Z
000000100000040001ABC
000000100000050001ABCRST
000000100000050001ABCXYZ
000000100000050001EFGRST
000000100000050001EFGXYZ
000000100000050001HIJRST
000000100000050001HIJXYZ

Need to know how do i create an SPLICE JCL for above case
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Oct 17, 2007 10:20 am    Post subject:
Reply with quote

sarbamrit
The example that you have shown says its many to many matching and is not possible by DFSORT/ICETOOL.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Nov 21, 2009 12:38 am    Post subject:
Reply with quote

With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), DFSORT now supports JOINKEYS which can do many to many matching. Here's the DFSORT job for this example:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  JOINKEYS F1=IN1,FIELDS=(8,7,A,15,4,A)
  JOINKEYS F2=IN2,FIELDS=(1,7,A,8,4,A)
  JOIN UNPAIRED,F1
  REFORMAT FIELDS=(F1:1,21,F2:12,3)
  OPTION COPY
/*


For complete details on JOINKEYS and the other new functions available with the Nov, 2009 DFSORT PTF, see:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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