S
PL_
PL_
PL_READ{%}FROM{%},{%}{WTHEN\ELSE}
*
      L$$$ = {%3}
      IF L$$$ > PLIP$MAX.IO.LEN THEN
         L$$$ = PLIP$MAX.IO.LEN
      END
*
      S$ = CALLFN(          \
                  '08':OCONV(L$$$,'MCDX')'R%4': \
                  FNR.READ:                  \ ;* Function code
                  OCONV({%2},'MCDX')'R%4':   \ ;* P.NO
                  OCONV(L$$$,'MCDX')'R%4':   \ ;* MAX.LEN
                  STR(NUL,L$$$)             \ ;* Read data area
                  )
*
      IF S$[7,4] = IPX.SOCKET.NO THEN
         RES = OCONV(S$[11,4],'MCXD')
         IF RES > 32768 THEN
            RES = RES - 65536
         END ELSE
            {%1} = S$[23,RES]
         END
         ERR = 0
      END ELSE
         ERR = 1
         RES = 0
      END
*
      IF NOT(ERR) AND RES >= 0 {%4}
