You need to do a better job of explaining what you want to do.
When do you want a field from the base record and when do you want a field from the overlay record. What about these cases:
1) field in base record and overlay record are nonblank
2) field in base record is blank and field in overlay record is nonblank
3) field in base record is nonblank and field in overlay record is blank
Which cases apply to which fields? Is it just the field in 50-57 that you want to handle in a special way or all of the WITH fields?
Please show a better example of input and expected output with all of the possible cases you want to handle. Explain the rules for getting from input to output.
want only the fields from Overlay record irrespective of blanks or nonblanks in Base record as well as Overlay record.
This applies to all the WITH fields except ON fields.
But in your output example you show 61-62 containing the field from the base record rather than from the overlay record. Was this a mistake? Would you really want blanks in 61-62 (as in the overlay record)? If not, what is the rule for that?
Also, for ON(19,10,CH), you have PPS fields in one case and PSS fields in the other case, so they won't match.
So I'm not sure what you really want, but try removing WITHANY and see if that does it. If not, explain more carefully what you want to do with an example that makes sense.