Command reference / sys

ENDTCP

End TCP/IP

Ends all TCP/IP processing on the system. OPTION(*IMMED) ends all TCP/IP connections and the applications using sockets, ends the TCP/IP server jobs unless ENDSVR(*NO) is specified, ends active agents in QSYSWRK, and ends all active TCP/IP interfaces. OPTION(*CNTRLD) stops new open operations on TCP, UDP and raw sockets, then submits a job to QSYSWRK that performs an immediate end after the DELAY time. An ENDTCP OPTION(*IMMED) issued during a controlled end cancels it. The command ends all TCP/IP processing and must be used carefully.

Allowed environments: *ALL. Positional parameters: 2.

Restrictions

Parameters

OPTION How to end

Specifies whether TCP/IP processing is ended immediately or in a controlled manner.

Type
*CHAR
Required
No
Default
*IMMED
Length
7
Case
Uppercase

Allowed values: *IMMED, *CNTRLD

*IMMED
TCP/IP processing ends immediately. Partially updated data may result if an application is mid-operation, so users should be notified first.
*CNTRLD
Applications get time to finish, new application processing is not allowed, and the immediate end runs after the delay. It does not check for completion or notify active applications.

DELAY Controlled end delay time

Specifies the number of seconds allowed to complete a controlled end of TCP/IP processing. After this period all TCP/IP processing ends immediately.

Type
*UINT4
Required
No
Default
30
Range
1 to 86400
Case
Uppercase

ENDSVR End application servers

Specifies whether all TCP/IP application server jobs are ended when ENDTCP ends TCP/IP processing. Consider the effects before specifying *NO.

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

Allowed values: *YES, *NO

*YES
All TCP/IP application servers are ended before TCP/IP processing ends.
*NO
No TCP/IP application server jobs are ended. Jobs using AnyNet continue to function.

CONFIRM Confirm

Specifies whether the request should be confirmed before TCP/IP is ended.

Type
*CHAR
Required
No
Default
*ENVVAR
Length
9
Case
Uppercase

Allowed values: *ENVVAR, *INTERACT, *YES, *NO

*ENVVAR
The QIBM_ENDTCP_CONFIRM environment variable determines confirmation. If it is undefined or not *INTERACT, *YES or *NO, there is no confirmation.
*INTERACT
A confirmation panel is shown in interactive jobs only; there is no confirmation in non-interactive jobs.
*YES
A confirmation panel is shown in interactive jobs; an inquiry message is sent to QSYSOPR in non-interactive jobs.
*NO
There is no confirmation.

Examples

ENDTCP OPTION(*IMMED)

Ends all TCP/IP processing on the system immediately.

ENDTCP OPTION(*CNTRLD) DELAY(120)

Ends all TCP/IP processing after 120 seconds; new TCP/IP processing is not allowed during that time.

IBM command documentation

Generated from os/cl/catalog/ENDTCP.json and os/cl/help/ENDTCP.json.