More information is needed. Can there be duplicates in DS2? Can there be records in DS1 for which there is no match in DS2? What RECFM and LRECL ? Is this match on the entire record or on selected fields?
Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at: