MRGTCPHT (Merge TCP/IP Host Table)
MRGTCPHT Command syntax diagram
Purpose
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.
Restriction: You must have *IOSYSCFG special authority to use this command.
Required Parameters
- FROMFILE
- Specifies the name of the physical file that contains the member being used for the merge operation. If no library qualifier is specified, the library list (*LIBL) is used to locate the file.
The name of the physical file member can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*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.
library-name: Specify the name of the library to be searched.
from-file: Specify the name of the physical file.
Optional Parameters
- FROMMBR
- Specifies the name of 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.
from-member: Specify the name of the physical file member.
- FILEFMT
- Specifies whether the physical file member to be merged with the local host table is *AS400, *AIX, or *NIC format.
*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 AS/400 system running Version 3, Release 1, Modification 0 (V3R1M0) or later of OS/400. If you import a host table from an AS/400 system running any version of OS/400 prior to V3R1M0, specify *AIX as the FILEFMT. *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.
- 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.
Examples for MRGTCPHT
Example 1: Replacing Local Host Table
MRGTCPHT FROMFILE(AS400FILE) REPLACE(*YES)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 AS/400 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.
Error messages for MRGTCPHT
*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.