The following code returns a pointer to a HOSTENT structure, which contains the alias names and the internet addresses of a host whose domain name is specified as input. For the callable service, see gethostbyname (BPX1GHN, BPX4GHN) Get IP information for specified host domain names.
MVC HOST_NAME(8),=CL8'HOST1234'
MVC HOST_NAMELEN,=F'8'
SPACE ,
CALL BPX4GHN, Get host by name +
(HOST_NAME, Input: Name of Host being queried +
HOST_NAMELEN, Input: Length of host name +
HOSTENT_PTR, Output: 0 or -> HOSTENT structure +
RETVAL, Return code +
RETCODE, Return code +
RSNCODE), Reason code +
MF=(E,PLIST) ----------------------------------