Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1243
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 Weirdo results with JOINKEYS Balaryan DFSORT/ICETOOL 4 Wed Oct 18, 2017 9:04 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us