if no, provide more information of how the two sas datasets get created,
is there any processing done while creating the two SAS datasets?
what is the input statement used? (to understand the layout of the file)
what would be the put statement used to write the SAS datsets into external files?
More relevant information will be useful.
If you want more specific help to do this with DFSORT, 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: