View previous topic :: View next topic
Author
Message
srajanbose New User Joined: 11 Oct 2004Posts: 69 Location: chennai
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
Marso REXX Moderator Joined: 13 Mar 2006Posts: 1353 Location: Israel
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
Please enable JavaScript!