Optimized solution on mainframe inflight masking