You can use DFSORT to do this. DFSORT can always process a KSDS as TYPE V. DFSORT can process a KSDS as TYPE F if all of the records are the same length.
Let's assume the string you want to check starts in data position 21.
With TYPE V processing, the starting position would be 25 (21 + 4 for the RDW that DFSORT uses) and you could use this DFSORT job to write only the records with the given string to the output data set:
I don't know what you mean by "else write in to empty file.". You need to explain what you mean by this if you want more help. Showing an example of your input recoreds and what you expect for output would be a good way to clarify what you need.