First I want thank you Billy for the quick response.I tried so many combinations but I am not getting the expected output.
Yes,you are right! I want to show the output in the original order.
For an Example,
1. 1st 9th byte of File1(CFEISEBB1)is matching with the File2 . So CFEISEBB1HI should come in the output file.
2. 1st 9th byte of File1(CFEISEAA1) is not matching with the File2. So CFEISEAA1HELLO should not come in the output file.The whole line should be removed from the Fil1.
File Description with the details:-
1. File1 is a VB file and record length of 14004. 1st 9bytes records of File1 need to match with the 1st 9bytes of records
of File2.Basically I want to eliminate the records from File1, depending on the 1st 9bytes of File2.
2. File2 is also a VB file and record length of 99.
File1:-
CFEISEAA1HELLO
CFEISEBB1HI
CFEISECC1UDAY
CEEISEZZ MODI
CFEISEBB1RUPAK
CEEISEMM KAUSHIK
CFEISEBB1SUNDARBAN
CEEISEZZ UJJAL
CFEISEBB1HI
File2:-
CFEILA
CEEISEZZ
CFEISEBB1
CFEILI
CFEISERR1
Output File records:-
CFEISEBB1HI
CEEISEZZ MODI
CFEISEBB1RUPAK
CFEISEBB1SUNDARBAN
CEEISEZZ UJJAL
CFEISEBB1HI
Please find below the code that I tried but not getting the result:-
//STEP01 EXEC PGM=SYNCSORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN= File1, DISP=SHR
//SORTJNF2 DD DSN= File2, DISP=SHR
//SORTOUT DD DSN= OutputFile,vol=(,,,99),
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSALLDA
//SYSIN DD *
JOINKEYS File=F1,FIELDS(5,9,A) (I start it from 5th position as the 1st 4th
JOINKEYS File=F2,FIELDS(5,9,A) bytes are blocked for FB file)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,14004,F2:1,99,?)
OPTION COPY
OUTFIL FNAMES=SORTOUT,INCLUDE=(14104,1,CH,EQ,C'1'),
BUILD=(1,14004)
//*
Billy, Please help me.