Copy / Overlay duplicate Records



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

Copy / Overlay duplicate Records

Postby rayngerfan » Fri Apr 17, 2009 7:57 pm

To Whom It May Concern:

I have 2 flat files RECFM=FB,LRECL=130. 1st file has 4 records & the 2nd file has 20 records.

1st file

09 Apr 09 BRXGL23V - STARTED - TIME=06.02 ENDED - TIME=06.03 TERMINATED UNSUCCESSFULL
08 Apr 09 BRXG47ZZ - STARTED - TIME=20.28 ENDED - TIME=20.29 TERMINATED UNSUCCESSFULL
10 Apr 09 BRXGL96W - STARTED - TIME=18.45 ENDED - TIME=18.47 TERMINATED UNSUCCESSFULL
09 Apr 09 BRXG58ZZ - STARTED - TIME=19.43 ENDED - TIME=19.48 TERMINATED UNSUCCESSFULL


2nd file
09 Apr 09 BRXGL23V - STARTED - TIME=06.02 ENDED - TIME=06.03
08 Apr 09 BRXG47ZZ - STARTED - TIME=20.28 ENDED - TIME=20.29
10 Apr 09 BRXGL96W - STARTED - TIME=18.45 ENDED - TIME=18.47
09 Apr 09 BRXG58ZZ - STARTED - TIME=19.43 ENDED - TIME=19.48
10 Apr 09 BRXG59ZZ - STARTED - TIME=19.40 ENDED - TIME=19.43
10 Apr 09 BRXG60ZZ - STARTED - TIME=17.51 ENDED - TIME=17.53
10 Apr 09 BRXG46ZZ - STARTED - TIME=19.40 ENDED - TIME=19.44
10 Apr 09 BRXG14ZZ - STARTED - TIME=16.38 ENDED - TIME=16.43
10 Apr 09 BRXG42ZZ - STARTED - TIME=16.55 ENDED - TIME=16.58
10 Apr 09 BRXG29ZZ - STARTED - TIME=17.00 ENDED - TIME=17.03
10 Apr 09 BRXG40ZZ - STARTED - TIME=17.14 ENDED - TIME=17.17
11 Apr 09 BRXG15ZZ - STARTED - TIME=06.01 ENDED - TIME=06.01
10 Apr 09 BRXG22ZZ - STARTED - TIME=19.40 ENDED - TIME=19.44
10 Apr 09 BRXG23ZZ - STARTED - TIME=17.53 ENDED - TIME=17.55
10 Apr 09 BRXG20ZZ - STARTED - TIME=19.40 ENDED - TIME=19.45
*******************************************************************************************************
I want to copy / overlay the records in the 1st file with the matching records in the 2nd file based on the job name.
I need to keep the remaining records in the 2nd file that don't have a matching record in the 1st file.

Output file will look like this

09 Apr 09 BRXGL23V - STARTED - TIME=06.02 ENDED - TIME=06.03 TERMINATED UNSUCCESSFULL
08 Apr 09 BRXG47ZZ - STARTED - TIME=20.28 ENDED - TIME=20.29 TERMINATED UNSUCCESSFULL
10 Apr 09 BRXGL96W - STARTED - TIME=18.45 ENDED - TIME=18.47 TERMINATED UNSUCCESSFULL
09 Apr 09 BRXG58ZZ - STARTED - TIME=19.43 ENDED - TIME=19.48 TERMINATED UNSUCCESSFULL
10 Apr 09 BRXG59ZZ - STARTED - TIME=19.40 ENDED - TIME=19.43
10 Apr 09 BRXG60ZZ - STARTED - TIME=17.51 ENDED - TIME=17.53
10 Apr 09 BRXG46ZZ - STARTED - TIME=19.40 ENDED - TIME=19.44
10 Apr 09 BRXG14ZZ - STARTED - TIME=16.38 ENDED - TIME=16.43
10 Apr 09 BRXG42ZZ - STARTED - TIME=16.55 ENDED - TIME=16.58
10 Apr 09 BRXG29ZZ - STARTED - TIME=17.00 ENDED - TIME=17.03
10 Apr 09 BRXG40ZZ - STARTED - TIME=17.14 ENDED - TIME=17.17
11 Apr 09 BRXG15ZZ - STARTED - TIME=06.01 ENDED - TIME=06.01
10 Apr 09 BRXG22ZZ - STARTED - TIME=19.40 ENDED - TIME=19.44
10 Apr 09 BRXG23ZZ - STARTED - TIME=17.53 ENDED - TIME=17.55
10 Apr 09 BRXG20ZZ - STARTED - TIME=19.40 ENDED - TIME=19.45
*******************************************************************************************************************************
I'm not sure if Syncsort can create this type of output. Any help is greatly appreciated.
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Copy / Overlay duplicate Records

Postby Alissa Margulies » Mon Apr 20, 2009 8:56 pm

Rayngerfan,

Here is a SyncSort JOIN application that will do what you asked:
//STEP1 EXEC PGM=SORT                     
//SORTJNF1 DD *
09 Apr 09 BRXGL23V - STARTED - TIME=06.02 ENDED - TIME=06.03
08 Apr 09 BRXG47ZZ - STARTED - TIME=20.28 ENDED - TIME=20.29
10 Apr 09 BRXGL96W - STARTED - TIME=18.45 ENDED - TIME=18.47
09 Apr 09 BRXG58ZZ - STARTED - TIME=19.43 ENDED - TIME=19.48
10 Apr 09 BRXG59ZZ - STARTED - TIME=19.40 ENDED - TIME=19.43
10 Apr 09 BRXG60ZZ - STARTED - TIME=17.51 ENDED - TIME=17.53
10 Apr 09 BRXG46ZZ - STARTED - TIME=19.40 ENDED - TIME=19.44
10 Apr 09 BRXG14ZZ - STARTED - TIME=16.38 ENDED - TIME=16.43
10 Apr 09 BRXG42ZZ - STARTED - TIME=16.55 ENDED - TIME=16.58
10 Apr 09 BRXG29ZZ - STARTED - TIME=17.00 ENDED - TIME=17.03
10 Apr 09 BRXG40ZZ - STARTED - TIME=17.14 ENDED - TIME=17.17
11 Apr 09 BRXG15ZZ - STARTED - TIME=06.01 ENDED - TIME=06.01
10 Apr 09 BRXG22ZZ - STARTED - TIME=19.40 ENDED - TIME=19.44
10 Apr 09 BRXG23ZZ - STARTED - TIME=17.53 ENDED - TIME=17.55
10 Apr 09 BRXG20ZZ - STARTED - TIME=19.40 ENDED - TIME=19.45
//SORTJNF2 DD *
09 Apr 09 BRXGL23V - STARTED - TIME=06.02 ENDED - TIME=06.03 TERMINATED UNSUCCESSFULL
08 Apr 09 BRXG47ZZ - STARTED - TIME=20.28 ENDED - TIME=20.29 TERMINATED UNSUCCESSFULL
10 Apr 09 BRXGL96W - STARTED - TIME=18.45 ENDED - TIME=18.47 TERMINATED UNSUCCESSFULL
09 Apr 09 BRXG58ZZ - STARTED - TIME=19.43 ENDED - TIME=19.48 TERMINATED UNSUCCESSFULL
//SORTOUT DD SYSOUT=*                     
//SYSOUT DD SYSOUT=*                     
//SYSIN DD *                             
  JOINKEYS FILES=F1,FIELDS=(11,8,A)       
  JOINKEYS FILES=F2,FIELDS=(11,8,A)       
  JOIN UNPAIRED,F1                       
  REFORMAT FIELDS=(F1:1,61,F2:62,23)     
  SORT FIELDS=COPY                       
/*       

The following output is produced if each record in File 1 contains a unique job name:
09 Apr 09 BRXGL23V - STARTED - TIME=06.02 ENDED - TIME=06.03 TERMINATED UNSUCCESSFUL
10 Apr 09 BRXGL96W - STARTED - TIME=18.45 ENDED - TIME=18.47 TERMINATED UNSUCCESSFUL
10 Apr 09 BRXG14ZZ - STARTED - TIME=16.38 ENDED - TIME=16.43                         
11 Apr 09 BRXG15ZZ - STARTED - TIME=06.01 ENDED - TIME=06.01                         
10 Apr 09 BRXG20ZZ - STARTED - TIME=19.40 ENDED - TIME=19.45                         
10 Apr 09 BRXG22ZZ - STARTED - TIME=19.40 ENDED - TIME=19.44                         
10 Apr 09 BRXG23ZZ - STARTED - TIME=17.53 ENDED - TIME=17.55                         
10 Apr 09 BRXG29ZZ - STARTED - TIME=17.00 ENDED - TIME=17.03                         
10 Apr 09 BRXG40ZZ - STARTED - TIME=17.14 ENDED - TIME=17.17                         
10 Apr 09 BRXG42ZZ - STARTED - TIME=16.55 ENDED - TIME=16.58                         
10 Apr 09 BRXG46ZZ - STARTED - TIME=19.40 ENDED - TIME=19.44                         
08 Apr 09 BRXG47ZZ - STARTED - TIME=20.28 ENDED - TIME=20.29 TERMINATED UNSUCCESSFUL
09 Apr 09 BRXG58ZZ - STARTED - TIME=19.43 ENDED - TIME=19.48 TERMINATED UNSUCCESSFUL
10 Apr 09 BRXG59ZZ - STARTED - TIME=19.40 ENDED - TIME=19.43                         
10 Apr 09 BRXG60ZZ - STARTED - TIME=17.51 ENDED - TIME=17.53           
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: Copy / Overlay duplicate Records

Postby rayngerfan » Tue May 05, 2009 6:58 pm

Hi Alissa

That niformation was a big help. thanks
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post