IBM Support

REXX Socket Calls Fail with Undefined Socket ERRNO

Question & Answer


Question

A REXX exec application using TCP/IP Socket calls receives the error 2009 ESOCKETNOTDEFINED Socket not defined.

Cause

This error condition is a normal response whenever a socket call is issued that specifies a nonexistent socket number. It can also occur when using nested invocations of multiple execs using the ISPF SELECT service (not to be confused with the sockets SELECT call). If the application is using sockets created within one exec from another exec, the attempted usage fails with the above error as well.

Answer

Ensure that the correct socket number is being supplied to the sockets function.

If the problem is the use of nested execs running under ISPF, correct the application logic to use each exec's invocation of the Sockets API services as its own environment. Use the GIVESOCKET and TAKESOCKET calls if the sockets need to be passed from one exec to the other.

[{"Product":{"code":"SSSN3L","label":"z\/OS Communications Server"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"All","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"1.6;1.7;1.8;1.9;1.10;1.11;1.12;1.13;2.1;2.2;2.3","Edition":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
15 June 2018

UID

swg21198584