TAA Tools
RTVHOSTNAM      RETRIEVE HOST NAME                     TAATCPG

The Retrieve  Host  Name command  uses an  IP address  to retrieve  the
name of  a host and  up to 4  alias names.   The command may  be useful
when  the  IP  address  is  known,  but  not  the  system  name.    The
'gethostbyaddr' API is used.

A typical series of commands would be:

             DCL           &HOSTNAME *CHAR LEN(255)
              .
             RTVHOSTNAM    IPADDR(xxx) HOSTNAME(&HOSTNAME)

The host name associated with the IP address would be returned.

The TAA9891 message  will be  sent if the  IP address  is not found  in
the system's host table or in the domain name server.

If the  message is  sent for  an internal address,  the address  can be
added to  the host table.  Use CFGTCP with  Option 10 and then Option 1
to prompt for the ADDTCPHTE command and specify the address.

Security
--------

The API used  by RTVHOSTNAM requires some  more than *PUBLIC  authority
to the output  queue.  As the information appears  to be non-sensitive,
the  CPP for RTVHOSTNAM  adopts QSECOFR profile  to avoid authorization
errors.

RTVHOSTNAM escape messages you can monitor for
----------------------------------------------

      TAA9891    An error such as invalid address or no host name

Escape messages from based on functions will be re-sent.

Command parameters                                    *CMD
------------------

   IPADDR        The IP address of the host.

   HOSTNAME      The name  of the  host.   This is  an optional  return
                 variable  that if  used  must  be specified  as  *CHAR
                 LEN(255).

   ALIAS1        The  first alias  assigned to  the host.   This  is an
                 optional   return  variable  that   if  used  must  be
                 specified as *CHAR LEN(255).

   ALIAS2        The second  alias assigned to  the host.   This is  an
                 optional  return   variable  that  if   used  must  be
                 specified as *CHAR LEN(255).

   ALIAS3        The  third alias  assigned to  the host.   This  is an
                 optional  return  variable  that   if  used  must   be
                 specified as *CHAR LEN(255).

   ALIAS4        The fourth  alias assigned  to the host.   This  is an
                 optional   return  variable  that  if   used  must  be
                 specified as *CHAR LEN(255).

Restrictions
------------

Because the command  returns a variable, it  may only be  used in a  CL
program.

Prerequisites
-------------

The following TAA Tools must be on your system:

     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   RTVHOSTNAM    *CMD                   TAATCPG       QATTCMD
   TAATCPGC      *PGM       CLP         TAATCPGC      QATTCL
   TAATCPGR      *PGM       RPGLE       TAATCPGR      QATTRPG
					

Added to TAA Productivity tools June 15, 2004


Home Page Up to Top