Merge TCP/IP Host Table (MRGTCPHT)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Merge TCP/IP Host Table (MRGTCPHT) command is used to merge host names, internet addresses, and text comment entries from a physical file member into the local host table. A replace option is also provided that allows the entire local host table to be replaced by the host table entries in a user specified physical file member.

A file format option is provided that allows either *AS400, *AIX, or *NIC file format to be merged with the local host table. The local host table is located in member QUSRSYS/QATOCHOST.HOSTS and is created as a physical file.

A maximum of 4 host names per IP address is allowed when host tables are merged. For example: If the local host table already has 3 host names and the physical file member to be merged has 2 additional host names, only the first host name in the physical file is merged into the final host table. Host names that exist both in the local host table and the physical file member being merged are not duplicated.

Attention: The original copy of the local host table is not saved by the Merge TCP/IP Host Table (MRGTCPHT) command. To save the original host table, create a copy of the file QUSRSYS/QATOCHOST.HOSTS using the Copy File (CPYF) command. Do this before issuing the MRGTCPHT command.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
FROMFILE From file Qualified object name Required, Positional 1
Qualifier 1: From file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
FROMMBR From member Name, *FIRST, *LAST Optional, Positional 2
FILEFMT File format *AS400, *AIX, *NIC Optional
REPLACE Replace host table *NO, *YES Optional
Top

From file (FROMFILE)

Specifies the physical file that contains the member being used for the merge operation.

Qualifier 1: From file

name
Specify the name of the physical file.

Qualifier 2: Library

*LIBL
All libraries in the job's library list are searched.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library where the physical file is located.
Top

From member (FROMMBR)

Specifies the physical file member to be used in the merge operation.

*FIRST
The first member of the physical file is used to merge with the host table.
*LAST
The last member of the physical file is used to merge with the host table.
name
Specify the name of the physical file member to be used.
Top

File format (FILEFMT)

Specifies the format of the physical file member to be merged with the local host table.

*AS400
The physical file member to be merged with the local host table is *AS400 format.

Note: *AS400 can only be used if the physical file member specified is a host table from an iSeries running Version 3, Release 1, Modification 0 (V3R1M0) or later of OS/400. If you import a host table from a system running any version of OS/400 prior to V3R1M0, specify *AIX.

*AIX
The physical file member to be merged with the local host table is *AIX format.
*NIC
The physical file member to be merged with the local host table is *NIC format.
Top

Replace host table (REPLACE)

Specifies whether the physical file member is to be merged with or replaces the local host table.

*NO
The physical file member is merged with the local host table.
*YES
The physical file member replaces the local host table.
Top

Examples

Example 1: Replacing Local Host Table

MRGTCPHT   FROMFILE(AS400FILE)  REPLACE(*YES) FILEFMT(*AS400)

This command replaces the contents of QUSRSYS/QATOCHOST.HOSTS with the contents of the first member of physical file AS400FILE. The first member of physical file AS400FILE is in *AS400 host table format.

Example 2: Merging Local Host Table

MRGTCPHT   FROMFILE(HOSTLIB/NICFILE)  FROMMBR(NEWHOSTS)  FILEFMT(*NIC)

This command merges the current contents of the local host table with the contents of the NEWHOSTS member of physical file NICFILE in library HOSTLIB. The physical file is in *NIC format. The records are converted from *NIC format to *AS400 format by this command.

Top

Error messages

*ESCAPE Messages

TCP1927
Records of file &1, member &2 not valid.
TCP1929
Host table not available.
TCP1934
Merge file &1, member &3, in library &2 not found.
TCP8050
*IOSYSCFG authority required to use &1.
Top