ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/runrmtcmd.htm

352 lines
14 KiB
HTML

<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Run Remote Command (RUNRMTCMD)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="RUNRMTCMD.Top_Of_Page"></a>
<h2>Run Remote Command (RUNRMTCMD)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>No
</td>
<td valign="top" align="right">
<a href="#RUNRMTCMD.PARAMETERS.TABLE">Parameters</a><br>
<a href="#RUNRMTCMD.COMMAND.EXAMPLES">Examples</a><br>
<a href="#RUNRMTCMD.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="RUNRMTCMD"></a>
<p>The Run Remote Command (RUNRMTCMD) command, also known as AREXEC when an SNA address is specified for the remote location name, allows server users to run a command on a remote system that is running the target portion of this function.
</p>
<p>The target portion of this function can be an <u> rexecd</u> (remote executing) daemon if you specify *IP for the address type, or an <u> AREXECD</u> (APPC remote executing) daemon if you specify *SNA for the address type.
</p>
<p>When the command is sent to the remote system, the local system waits for the command to complete and the output from the remote command will be placed in a spooled file.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RUNRMTCMD.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="RUNRMTCMD.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top"><a href="#RUNRMTCMD.CMD"><b>CMD</b></a></td>
<td valign="top">Command</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Required, Positional 1</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#RUNRMTCMD.RMTLOCNAME"><b>RMTLOCNAME</b></a></td>
<td valign="top">Remote location</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="3">Required, Positional 2</td>
</tr>
<tr>
<td valign="top">Element 1: Name or address</td>
<td valign="top">
<i>Character value</i></td>
</tr>
<tr>
<td valign="top">Element 2: Type</td>
<td valign="top">
<b><u>*SNA</u></b>, *IP</td>
</tr>
<tr>
<td valign="top"><a href="#RUNRMTCMD.RMTUSER"><b>RMTUSER</b></a></td>
<td valign="top">Remote user ID</td>
<td valign="top"><i>Character value</i>, <b><u>*NONE</u></b>, *CURRENT</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RUNRMTCMD.RMTPWD"><b>RMTPWD</b></a></td>
<td valign="top">Remote password</td>
<td valign="top"><i>Character value</i>, <b><u>*NONE</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RUNRMTCMD.MODE"><b>MODE</b></a></td>
<td valign="top">Mode</td>
<td valign="top"><i>Communications name</i>, <b><u>*NETATR</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RUNRMTCMD.CCSID"><b>CCSID</b></a></td>
<td valign="top">Coded character set ID</td>
<td valign="top">1-65533, <b><u>*CALC</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RUNRMTCMD.WAITTIME"><b>WAITTIME</b></a></td>
<td valign="top">Wait time (in seconds)</td>
<td valign="top">2-3600, <b><u>*NOMAX</u></b>, *NOWAIT</td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#RUNRMTCMD.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="RUNRMTCMD.CMD"></a>
<h3>Command (CMD)</h3>
<p>Specifies a character string of up to 2000 characters that represents a command that is run on the target system. The maximum length supported by the target system may be less than 2000 characters. If you specify a command string that exceeds the maximum length supported by the target system, the command will fail.
</p>
<p>The command must be enclosed in apostrophes if it contains embedded blanks or special characters.
</p>
<p>
<b>Note: </b>The normal rule of pairing apostrophes in quoted strings on the local system must be <u> doubled</u> when the same string is submitted to a remote system on this CMD parameter; this is required because the user is coding a quoted string within another quoted string. Therefore, when this parameter is being coded, wherever a single apostrophe would normally be paired with another apostrophe, <u> each occurrence in the inside set of apostrophes must be doubled</u> to produce the same results at the target system.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RUNRMTCMD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RUNRMTCMD.RMTLOCNAME"></a>
<h3>Remote location (RMTLOCNAME)</h3>
<p>Specifies the name of the target system and the type of connection used to connect to the target system.
</p>
<p>The possible <b>name or address</b> values are dependent on the address type.
</p>
<p>When the address type is *SNA, specify the name of the target system using the format nnnnnnnn.cccccccc, where nnnnnnnn is the network identifier (ID) and cccccccc is the remote location name. If no network ID is specified, the network attributes are used to determine the default network ID.
</p>
<p>When the address type is *IP, specify a host name or an internet address to identify the target system. Host names must follow these conventions:
</p>
<ul>
<li>The first character must be either A through Z or 0 through 9.
</li>
<li>The last character must be either A through Z, 0 through 9, or a period (.).
</li>
<li>Blanks ( ) are not allowed.
</li>
<li>The special characters, period (.), underscore (_), and minus (-) are allowed.
</li>
<li>Parts of the name separated by periods (.) cannot exceed 63 characters in length.
<p>
<b>Note: </b>Each part of the name separated by periods (.) must begin and end with an English alphabetic character or a numeric character.
</p>
</li>
<li>Names must be from 1 to 255 characters in length.
</li>
</ul>
<p>The internet address is specified in the form <u> nnn.nnn.nnn.nnn</u> , where <u> nnn</u> is a decimal number ranging from 0 through 255. An internet address is not valid if it has a value of all binary ones or all binary zeros for the network identifier portion or the host ID portion of the address. If the internet address is entered from a command line, the address must be enclosed in apostrophes.
</p>
<p>The possible <b>address type</b> values are:
</p>
<dl>
<dt><b><u>*SNA</u></b></dt>
<dd>The target system is accessed using a Systems Network Architecture (SNA) address and protocol.
</dd>
<dt><b>*IP</b></dt>
<dd>The target system is found using a host name or an internet address over a TCP/IP connection.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RUNRMTCMD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RUNRMTCMD.RMTUSER"></a>
<h3>Remote user ID (RMTUSER)</h3>
<p>Specifies the user identifier (ID) for the target system. If a user ID is specified for this parameter and password security is active on the target system, RMTPWD(*NONE) is not valid.
</p>
<p>The possible values are:
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No user ID is sent. If security on the target system is configured to require a user ID, the command will fail.
</dd>
<dt><b>*CURRENT</b></dt>
<dd>The user ID of the job (signed-on user) using this command is sent.
</dd>
<dt><b><i>remote-user-identifier</i></b></dt>
<dd>Specify a user ID to use that exists on the target system. If a user ID is specified and password security is active on the target system, a password must be specified.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RUNRMTCMD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RUNRMTCMD.RMTPWD"></a>
<h3>Remote password (RMTPWD)</h3>
<p>Specifies the password sent to the target system.
</p>
<p>The possible values are:
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>The system does not send a password. If a user identifier (ID) is specified on the RMTUSER parameter and password security is active on the target system, the command will fail.
</dd>
<dt><b><i>password</i></b></dt>
<dd>Specify a password sent to the target system to verify the sign-on of the user ID specified in the RMTUSER parameter. If an address type of *IP is specified, the password sent is not substituted across the communication line; if *SNA is specified, the password may or may not be substituted, depending on whether the remote system supports password substitution.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RUNRMTCMD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RUNRMTCMD.MODE"></a>
<h3>Mode (MODE)</h3>
<p>Specifies the name of the mode to be used when sending the command to the target system. This parameter is only allowed when the address type value is *SNA.
</p>
<p>The possible values are:
</p>
<dl>
<dt><b><u>*NETATR</u></b></dt>
<dd>The mode in the network attributes is used.
</dd>
<dt><b><i>mode-name</i></b></dt>
<dd>Specify a mode name. Specify BLANK for a mode name consisting of eight blank characters.
</dd>
</dl>
<p>
<b>Note: </b>SNASVCMG and CPSVCMG are reserved names and cannot be specified.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RUNRMTCMD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RUNRMTCMD.CCSID"></a>
<h3>Coded character set ID (CCSID)</h3>
<p>Specifies the coded character set identifier (CCSID) that will be used for conversions. When data is sent to the remote system, the data is converted using the CCSID of the job to the CCSID specified on the CCSID parameter. Similarly, when data is received from the remote system, the data is converted from the CCSID that was specified on the CCSID parameter to the CCSID of the job.
</p>
<p><b>Restrictions:</b>
</p>
<ol>
<li>If the CCSID of the job is 65535 (indicating no conversion), the default CCSID of the job will be used.
</li>
<li>This command uses the round-trip conversion method when converting data from the source CCSID to the target CCSID and back. For more information about CCSID conversion methods, see the National Language Support book.
</li>
</ol>
<p>The possible values are:
</p>
<dl>
<dt><b><u>*CALC</u></b></dt>
<dd>The CCSID value sent from the target system is used if it is available. If a value is not provided from the target system, a default value of 00819 (ISO 8859-1 8-bit ASCII) will be used.
</dd>
<dt><b><i>coded-character-set-identifier</i></b></dt>
<dd>The requested CCSID value is used. This value is validated to ensure a valid CCSID has been requested.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RUNRMTCMD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RUNRMTCMD.WAITTIME"></a>
<h3>Wait time (in seconds) (WAITTIME)</h3>
<p>Specifies the time in seconds to wait for the return (echo) before declaring the remote location to be unreachable.
</p>
<p>The possible values are:
</p>
<dl>
<dt><b><u>*NOMAX</u></b></dt>
<dd>The system waits forever.
</dd>
<dt><b>*NOWAIT</b></dt>
<dd>The system returns immediately if there is a connection ready and available.
</dd>
<dt><b><i>time-to-wait-for-reply</i></b></dt>
<dd>Specify the length of time in seconds. Valid values range from 2 through 3600 seconds.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RUNRMTCMD.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="RUNRMTCMD.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Run Remote Command (RUNRMTCMD) Using SNA Address Type</b>
</p>
<p>
<pre>
RUNRMTCMD CMD('dir') RMTLOCNAME((APPN.RMTSYS *SNA))
</pre>
</p>
<p>This command runs the 'dir' command on the system specified by 'RMTLOCNAME' using an SNA address type.
</p>
<p><b>Example 2: Run Remote Command (AREXEC) Using SNA Address Type</b>
</p>
<p>
<pre>
AREXEC CMD('dir') RMTLOCNAME(APPN.RMTSYS)
</pre>
</p>
<p>This command is equivalent to the command in example 1.
</p>
<p><b>Example 3: Run Remote Command Using IP Address Type and Host Name to Specify Target System</b>
</p>
<p>
<pre>
RUNRMTCMD CMD('ls') RMTLOCNAME((MYSYS.NET1.LOCAL *IP))
</pre>
</p>
<p>This command runs the 'ls' command on the system specified by host name MYSYS.NET1.LOCAL.
</p>
<p><b>Example 4: Run Remote Command Using IP Address Type and Internet Address to Specify Target System</b>
</p>
<p>
<pre>
RUNRMTCMD CMD('ls') RMTLOCNAME(('9.5.1.94' *IP))
</pre>
</p>
<p>This command runs the 'ls' command on the system specified by internet address '9.5.1.94'.
</p>
<p><b>Example 5: Run Remote Command With Multiple Commands Using IP Address Type and Internet Address to Specify Target System</b>
</p>
<p>
<pre>
RUNRMTCMD CMD('ls; cat myfile; date') RMTLOCNAME(('9.5.1.94' *IP))
</pre>
</p>
<p>This command runs multiple commands, first 'ls', then 'cat myfile', then 'date' on system specified by internet address '9.5.1.94'.
</p>
<p><b>Example 6: Run Remote Command With a Wait Time Expiration Value</b>
</p>
<p>
<pre>
RUNRMTCMD CMD('dir') RMTLOCNAME((APPN.RMTSYS *SNA)) WAITTIME(15)
</pre>
</p>
<p>This command runs the 'dir' command on the specified system. The maximum wait time for the remote location to respond is 15 seconds. A wait time is only allowed when using *SNA address type value.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RUNRMTCMD.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="RUNRMTCMD.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPF91CB</b></dt>
<dd>Problems occurred on the command, but the command completed.
</dd>
<dt><b>CPF91CC</b></dt>
<dd>Command did not complete successfully.
</dd>
<dt><b>CPF91CF</b></dt>
<dd>Command failed on remote system.
</dd>
<dt><b>CPF91C9</b></dt>
<dd>MODE value not allowed when *IP specified for RMTLOCNAME address type.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RUNRMTCMD.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>