z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


RESOLVE

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

Use the RESOLVE command to resolve a host name or an IP address.

Format

Read syntax diagramSkip visual syntax diagram
                                              .-,--30------.      
>>-SOCKET--(--"RESOLVE"--,--+-ipaddress----+--+------------+--)-><
                            +-hostname-----+  '-,--timeout-'      
                            '-fullhostname-'                      

Parameters

ipaddress
The IPv4 address of the system in dotted decimal format.
hostname
The host name, for example, BOB01. The maximum length is 255 characters.
Fullhostname
The fully qualified host name, for example, BOB01.THEWORLD.COM. The maximum length is 255 characters.
timeout
The resolver timeout value. By default, this is set to 30 seconds.

Returned value

The command returns a string that contains the return code, the IP address, and the host name. The return code can be 0, a REXX socket API error number, or the REXX TCP/IP error number that is set by the socket command. The return code 0 indicates that the requested socket command was completed successfully.

The following string is an example of what is returned by the RESOLVE command:
0 10.201.202.1 BOB01.THEWORLD.COM 
In the example, 0 is the return code, 10.201.202.1 is the host IP address, and BOB01.THEWORLD.COM is the host name.

See Socket call error return codes for additional information about the numeric error codes that are returned by this command.

The following REXX TCP/IP error number can be returned:
  • 22 EINVAL
The following REXX socket API error numbers can be returned:
  • 2001 EINVALIDRXSOCKETCALL
  • 2005 ESUBTASKNOTACTIVE
  • 2012 EINVALIDNAME
  • 2016 EHOSTNOTFOUND

LE C/C++ equivalent

This command has no LE C/C++ equivalent.

Code example

Figure 1. RESOLVE command example
/* REXX EZARXR23 */
/*
 * This sample demonstrates the use of the RESOLVE
 * socket command.
 */
src = socket("INITIALIZE","MYSET01");
src = socket("RESOLVE","your.hostname.here");
if word(src,1) = 0 then do
   Say "The host name is "WORD(src,3)
   Say "The IP Address is "WORD(src,2);
end;
src = socket("TERMINATE","MYSET01");
exit 0;

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014