IBM Support

Retrieve Netstat Information (NETSTAT2) in QSPTLIB

Troubleshooting


Problem

This document explains that Work with TCP/IP Network Status (NETSTAT) *CNN does not have an OUTPUT option to generate a spooled output or a database file.

Resolving The Problem

This document explains that Work with TCP/IP Network Status (NETSTAT) *CNN does not have an OUTPUT option to generate a spooled output or a database file.

The System i Software Support Tools Library is a collection of tools used by the System i Global Software Support Center. These programs are being provided as is without warranty or guarantee. There is no APAR support for this library. QSPTLIB is available in the RETAIN FDL in the following SAVEFILE PTFs:

o SE24152 - R540
o SE32507 - R610
o SE45610 - R710

To install the savefile PTF, you would do a RSTLIB of QSPTLIB from the savefile.

To use the Retrieve Netstat Information (NETSTAT2) command, you should do the following:

1. Issue the ADDLIBLE QSPTLIB command.
2. Issue the NETSTAT2 command.
3. Press F4 to prompt.

 Retrieve Netstat Information (NETSTAT2)          
                                                                       
 Type choices, press Enter.                                            
                                                                       
 File to receive output . . . . .        NETSTAT2         Name                
   Library  . . . . . . . . . . .     MYLIB       Name, *LIBL, *CURLIB
 Output member options:                                                
   Member to receive output . . .   *FIRST        Character value      
   Replace or add records . . . .   *REPLACE      *REPLACE, *ADD  

Specify the file name and its library to receive the output, and press the Enter key.

To view the receive output in your database file, you should issue the STRSQL command.

Fields in the database file are as follows:

FieldTypeLength
RMTADR CHARACTER 15
RMTPRTDECIMAL10
LCLADRCHARACTER 15
LCLPRTDECIMAL 10
TCPSTACHARACTER15
IDLTIM DECIMAL10
BYTINDECIMAL20
BYTOUTDECIMAL20
CNNOPNTYPCHARACTER 10
NETCNNTYPCHARACTER 10
"DATE"CHARACTER10
"TIME" CHARACTER 8
RMTADRNNUMERIC12

To see all fields, you should issue the following command:

SELECT * FROM MYLIB/NETSTAT2

To see specific fields, you should issue the following command:

SELECT RMTADR, RMTPRT, LCLADR, LCLPRT, TCPSTA, CNNOPNTYP, NETCNNTYP, "DATE", "TIME", RMTADRN FROM MYLIB/NETSTAT2

To generate a spooled output within STRSQL, you should do the following:

1. Press F13=Services.

2. Select Option 1. Change session attributes.

3. SELECT output . . . . . . . . 2 1=Display, 2=Printer 3=File

4. Run your SELECT statement.
[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number

649183719

Document Information

More support for:
IBM i

Software version:
6.1.0

Operating system(s):
IBM i

Document number:
684059

Modified date:
18 December 2019

UID

nas8N1010729

Manage My Notification Subscriptions