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
 

 

Joinkeys in SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
srajanbose
Warnings : 1

New User


Joined: 11 Oct 2004
Posts: 69
Location: chennai

PostPosted: Thu Oct 30, 2008 5:56 pm    Post subject: Joinkeys in SYNCSORT
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: 1226
Location: Israel

PostPosted: Thu Oct 30, 2008 8:37 pm    Post subject: Reply to: Joinkeys in SYNCSORT
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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