The technique shown above will do what you want for an FB file. If the input file has RECFM=FB and all of the X'00' values were not changed to X'40' values, then I can only guess that you did not set the recordlength in the OUTREC statement correctly. If the input file has RECFM=VB, then you need this OUTREC statement:
For more details, see the "Change all zeros in your records to spaces" Smart DFSORT Trick at:
If that doesn't help, then you need to tell me the RECFM and LRECL of your input file, show me the job you used, and give me an example of an input record and output record where all of the X'00' values were not changed to X'40' values.