now my query is i want to copy matching records to file3 and duplicate records from file1 to file4
It's not clear what you mean by this. Please show the output you expect for this input example and explain the rules for getting from input to output. Give the RECFM and LRECL of each input file. Give the starting position, length and format of each relevant field.
I'm guessing your input records don't really look like that. It would be better to show what your input records actually look like and what you expect for output.
Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD DUMMY
//SYSIN DD *