The problem is in the .WAITOUT subroutine. The original subroutine looks like this:
&IF &MAIFRLU = PLU &THEN &RETSUB
The trace shows what happens using this code.
11.28.15 N03802 00007900 PROC: JMTEST NCLID: 770424 &MAIREAD ANY
11.28.15 N51D01 TRACE OF DATASTREAM SENT TO SLU ON SESSION AP :
11.28.15 N51D01 +0000 F3000501 FF02 3... ..
11.28.15 N03802 00008000 PROC: JMTEST NCLID: 770424 &IF SLU = PLU
11.28.15 N03802 00008100 PROC: JMTEST NCLID: 770424 &MAIDEL
The PLU sends x'F3000501FF02...' to the SLU. This is the WSF (Write Structured Field) command code followed by a five-byte structured field. The first two bytes of the structured field form the length count. This in turn is followed by a x'01' to identify a Read Partition structured field. It is mandatory that the partition identifier byte has a value of x'FF'. The last byte is x'02' to indicate a Query. This Query is deleted in the current Script, likely causing it not to work.