Netstat command output
Use the following options to specify where and in which format output is written. If an output option is not specified, by default the output is displayed on the user's terminal.
- FORMat/-M
- Display a Netstat report in a given format.
- SHORT
- Display a Netstat report in short format. The short format is the format that supports only IPv4 IP addresses. This option is valid only if the stack is not IPv6 enabled.
- LONG
- Display a Netstat report in long format. The long format can accommodate both IPv4 and IPv6 IP addresses.
If . . . Then . . . The stack is IPv6 enabled The default format for the Netstat report is the long format. The stack is IPv6 enabled and the FORMAT/-M SHORT is specified from the command The error message EZZ2383I is issued and command processing is stopped. The stack is not IPv6 enabled and the FORMAT/-M option is not specified from the Netstat command line nor in the IPCONFIG profile statement The default format for Netstat report is the short format.
- REPort (TSO NETSTAT only)
- Causes the output to be stored in an MVS™ data set. If there is no additional parameter specified,
the output is stored in a data set named tsoprefix.NETSTAT.option. If NOPREFIX is set in the TSO user profile,
then the data set name is NETSTAT.option. The data set is created and cataloged if it does not already exist.
If the data set already exists, the output from the requested option
replaces any existing data. The name of the data set depends on whether
either of the following additional parameters were specified:
- DSN dsnname
- Specifies the data set name in which the output is stored. The dsnname can be either a fully qualified name surrounded by single quotation marks (for example, 'abc.xyz') or an unqualified name (for example, abc). If an unqualified name is specified, then the unqualified name is prefixed with the TSO prefix value.
- HLQ hlqname
- Specifies the high-level qualifier for the data set in which the output is stored. The resulting data set name is hlqname.NETSTAT.option.
The following shows the relationship between the parameters and the stored data set name:
No tsoprefix | tsoprefix is available | |
---|---|---|
Nothing specified | NETSTAT.option | tsoprefix.NETSTAT.option |
HLQ specified | hlqname.NETSTAT.option | hlqname.NETSTAT.option |
Unqualified DSN | dsnname | tsoprefix.dsnname |
Fully qualified DSN | dsnname | dsnname |
Use the REPort option to store the information returned by NETSTAT in a file used for later reference. For example, to store the output of the NETSTAT COnn report in a file, issue the following command: netstat conn report
After you issue the preceding command, a data set named tsoprefix.NETSTAT.CONN is created, which contains output similar to the following information:
MVS TCP/IP NETSTAT CS V2R2 TCPIP NAME: TCPCS 17:40:36
User Id Conn Local Socket Foreign Socket State
------- ---- ------------ -------------- -----
FTPD1 0000003B 0.0.0.0..21 0.0.0.0..0 Listen
FTPD1 0000003D 9.37.65.146..21 9.67.115.5..1026 Establsh
FTPD1 0000003F 9.37.65.146..21 9.27.13.21..3711 Establsh
TCPCS 0000000F 0.0.0.0..23 0.0.0.0..0 Listen
TCPCS 0000000C 9.67.115.5..23 9.27.11.182..4886 Establsh
SYSLOGD1 00000010 0.0.0.0..514 *..* UDP
- STAck (TSO NETSTAT only)
- Causes the report, stripped of title lines, to be placed in the
TSO data stack when NETSTAT is issued from a CLIST or a REXX EXEC. No
information is displayed at the user's terminal.
- TITLes
- Causes the report, including title lines, to be placed in the TSO data stack when NETSTAT is issued from a CLIST or a REXX EXEC.