Need help on joining two files!!!



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Need help on joining two files!!!

Postby ibmmf4u » Tue Mar 27, 2012 10:46 pm

Hi,

My requirement goes this way. I need to join the two files which were shown below by eliminating the duplicates in a field.

The first 1-8 char's are the key fields in both the files.

Input files:-

File1:-

 File1:-
MTPLB41A     01:02   32312
MTPLB41B     00:57   32312
MTPLB41C     01:13   32312
MTPLB41D     01:27   32312
MTPLB41E     01:16   32312



File2:-
File2:-
MTPLB41A   TEST.FILE1.SEND(0)   test.server.com   file1.txt
MTPLB41A   TEST.FILE2.SEND(0)   test.server.com   file2.txt
MTPLB41B   TEST.FILE3.SEND(0)   test.server.com   file3.txt
MTPLB41C   TEST.FILE4.SEND(0)   test.server.com   file4.txt
MTPLB41C   TEST.FILE5.SEND(0)   test.server.com   file5.txt
MTPLB41C   TEST.FILE6.SEND(0)   test.server.com   file6.txt
MTPLB41C   TEST.FILE7.SEND(0)   test.server.com   file7.txt
MTPLB41D   TEST.FILE8.SEND(0)   test.server.com   file8.txt
MTPLB41E   TEST.FILE9.SEND(0)   test.server3.com  file9.txt



Expected output file:-

Output file:-
MTPLB41A     01:02   32312   TEST.FILE1.SEND(0)   test.server.com   file1.txt
                             TEST.FILE2.SEND(0)   test.server.com   file2.txt
MTPLB41B     00:57   32312   TEST.FILE3.SEND(0)   test.server.com   file3.txt
MTPLB41C     01:13   32312   TEST.FILE4.SEND(0)   test.server.com   file4.txt
                             TEST.FILE5.SEND(0)   test.server.com   file5.txt
                             TEST.FILE6.SEND(0)   test.server.com   file6.txt
                             TEST.FILE7.SEND(0)   test.server.com   file7.txt
MTPLB41D     01:27   32312   TEST.FILE8.SEND(0)   test.server.com   file8.txt
MTPLB41E     01:16   32312   TEST.FILE9.SEND(0)   test.server3.com  file9.txt




Can some one please provide me the sort card in achieving the above??
ibmmf4u
 
Posts: 65
Joined: Wed Dec 14, 2011 10:26 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Need help on joining two files!!!

Postby Alissa Margulies » Tue Mar 27, 2012 11:13 pm

Hello ibmmf4u.

Here is a Syncsort MFX for z/OS application that should provide you with the desired results:

//STEP1  EXEC PGM=SORT     
//SYSOUT   DD SYSOUT=*                             
//SORTJNF1 DD *                                           
MTPLB41A     01:02   32312                                 
MTPLB41B     00:57   32312                                 
MTPLB41C     01:13   32312                                 
MTPLB41D     01:27   32312                                 
MTPLB41E     01:16   32312                                 
//SORTJNF2 DD *                                           
MTPLB41A   TEST.FILE1.SEND(0)   TEST.SERVER.COM   FILE1.TXT
MTPLB41A   TEST.FILE2.SEND(0)   TEST.SERVER.COM   FILE2.TXT
MTPLB41B   TEST.FILE3.SEND(0)   TEST.SERVER.COM   FILE3.TXT
MTPLB41C   TEST.FILE4.SEND(0)   TEST.SERVER.COM   FILE4.TXT
MTPLB41C   TEST.FILE5.SEND(0)   TEST.SERVER.COM   FILE5.TXT
MTPLB41C   TEST.FILE6.SEND(0)   TEST.SERVER.COM   FILE6.TXT
MTPLB41C   TEST.FILE7.SEND(0)   TEST.SERVER.COM   FILE7.TXT
MTPLB41D   TEST.FILE8.SEND(0)   TEST.SERVER.COM   FILE8.TXT
MTPLB41E   TEST.FILE9.SEND(0)   TEST.SERVER3.COM  FILE9.TXT
//SORTOUT DD SYSOUT=*                                     
//SYSIN   DD *
   JOINKEYS FILES=F1,FIELDS=(1,8,A)                                 
   JOINKEYS FILES=F2,FIELDS=(1,8,A)                                 
   REFORMAT FIELDS=(F1:1,29,F2:12,48)                               
   INREC IFTHEN=(WHEN=INIT,BUILD=(1,77,SEQNUM,8,ZD,RESTART=(1,8))),
         IFTHEN=(WHEN=(78,8,ZD,EQ,1),BUILD=(1,77)),
         IFTHEN=(WHEN=NONE,BUILD=(29X,30,48))       
   SORT FIELDS=COPY             
/*


Regards,
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: Need help on joining two files!!!

Postby ibmmf4u » Wed Mar 28, 2012 8:21 pm

Hi Alissa,

Thanks a lot , the above code worked fine.

I want to learn more on the syncsort, can you please send me the manual??

Can you please let me know the mail address where I can drop in the details of version as well CPU serial number??
ibmmf4u
 
Posts: 65
Joined: Wed Dec 14, 2011 10:26 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Need help on joining two files!!!

Postby Alissa Margulies » Wed Mar 28, 2012 8:53 pm

To request Syncsort documentation, please feel free to contact me at alissa.margulies@syncsort.com and I would be happy to further assist you.

Regards,
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post