S
PL_
PL_
PL_KILL.SESSION{%},{%}{WTHEN\ELSE}
*
      S$ = CALLFN('00':             \
                  FNR.KILL.SESSION:          \ ;* Function code
                  OCONV({%1},'MCDX')'R%4':   \ ;* P.NO
                  OCONV({%2},'MCDX')'R%2'    \ ;* Port type
                  )[3,999999]
*
      IF S$[1,4] = IPX.SOCKET.NO THEN
         RES = OCONV(S$[5,4],'MCXD')
         IF RES > 32768 THEN
            RES = RES - 65536
         END
         ERR = 0
      END ELSE
         ERR = 1
         RES = 0
      END
*
      IF NOT(ERR) AND RES >= 0 {%3}
