Programs written in COBOL use the CALL statement to exploit TCP/IP sockets:
CALL 'IDMSOCKI' USING
function,
return-code,
errno,
reason-code,
function-dependent-parameter1,
. . .
A call to IDMSOCKI must pass the following four parameters:
|
Parameter |
Description |
|---|---|
|
function |
Specifies a 4-byte, fullword-aligned, integer field that the program sets to the desired socket function. The following is the sample definition of a function field: 01 SOCKET-FUNCTION PIC S9(8) COMP. A detailed description of the supported functions can be found in Function Descriptions. |
|
return-code |
Specifies a 4-byte, fullword-aligned, integer field that receives the outcome of the operation. The following are the returned values:
The following is the sample definition of a return-code field: 01 SOCKET-RETCD PIC S9(8) COMP. |
|
errno |
Specifies a 4-byte, fullword-aligned, integer field that receives the ERRNO value when return-code is -1. The following is the sample definition of an errno field: 01 SOCKET-ERRNO PIC S9(8) COMP. For more information, see Return, Errno, and Reason Codes. |
|
reason-code |
Specifies a 4-byte, fullword-aligned, integer field that receives the reason code value when return-code is -1. The following is the example definition of a reason-code field: 01 SOCKET-RSNCD PIC S9(8) COMP. For more information, see Return, Errno, and Reason Codes. |
Depending on the function, zero or more parameters can follow.
|
Copyright © 2014 CA.
All rights reserved.
|
|