You can use a DFSORT job like the following to do what you asked for. p3,m3,f3 is the starting position, length and format of your third field and p4,m4,f4 is the starting position, length and format of your fourth field .
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
thanks..but i have made a mistake in explaining the problem...actually there are two files..I need to compare the 3rd field in the first file with the 4th field in the second file. if they are eual move to out1 else out2.