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

Joinkeys in SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srajanbose

New User


Joined: 11 Oct 2004
Posts: 69
Location: chennai

PostPosted: Thu Oct 30, 2008 5:56 pm
Reply with quote

I have two input files. I want to compare the two and write the duplicates(from both the file) into an output file. First input file is like below
Code:
APV;DPR;BAENREF
APV;DPR;BAEXDES
APV;DPR;BAEXDRE
APV;DPR;BAEXREF
APV;DPR;BAEXTRR
APV;DPR;BAEXTRT


Second file as below

Code:
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRAD;  BAENREF
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRAD;  BAENRPH
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRAD;  BAENRPT
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRAD;  BAEXDES
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRAD;  BAEXDIC
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRAD;  BAEXECI



Expected Output is like
Code:
APV;DPR;BAENREF
APV;DPR;BAEXDES
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRAD;  BAENREF   
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRAD;  BAEXDES   
I got the output like below
Code:
APV;DPR;BAENREFAPV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRAD;  BAENREF
APV;DPR;BAEXDESAPV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRAD;  BAEXDES

Please find below my jcl
Code:

//STEP150  EXEC SORT1                                             
//SORTJNF1 DD  DISP=SHR,                                           
//         DSN=OR7SQE.PFI.APV.D291008.PGM.BATCH                   
//SORTJNF2 DD  DISP=SHR,                                           
//         DSN=OR7SQE.SFI.HOMONYMS.BEFORE.LIST                     
//SORTOUT  DD  DSN=OR7SQE.SFI.L03.D250608.SIA.HOMONYMS.BATCH,     
//             DISP=(,CATLG,CATLG),                             
//             SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *                                                   
  JOINKEYS FILE=F1,FIELDS=(9,8,A)                                 
  JOINKEYS FILE=F2,FIELDS=(54,8,A)                                 
  REFORMAT FIELDS=(F1:1,15,F2:1,70)                               
  SORT FIELDS=COPY                                                 
/*                                                                 
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Oct 30, 2008 8:37 pm
Reply with quote

Yes, as you have requested, the matching lines are joined together according to the REFORMAT parameter and sent to the SORTOUT file.
This is what I would do (not necessarily the only possibility):

What you have to do is to split the data back to 2 different lines:
Code:
 OUTFIL FILES=01,OUTREC=(1,15) 
 OUTFIL FILES=02,OUTREC=(16,70)

Don't forget to replace the SORTOUT in the JCL by:
Code:
//SORTOF01 DD DSN=&OUT1,DISP=...
//SORTOF02 DD DSN=&OUT2,DISP=...

Later, you can concatenate the 2 files:
Code:
//NEWINPUT DD DISP=SHR,DSN=&OUT1
//         DD DISP=SHR,DSN=&OUT2
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Sort with JOINKEYS using two VB files DFSORT/ICETOOL 1
Search our Forums:

Back to Top