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

302 lines
12 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!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 (AREXEC)</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="AREXEC.Top_Of_Page"></a>
<h2>Run Remote Command (AREXEC)</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="#AREXEC.PARAMETERS.TABLE">Parameters</a><br>
<a href="#AREXEC.COMMAND.EXAMPLES">Examples</a><br>
<a href="#AREXEC.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="AREXEC"></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, <u> AREXECD</u> (APPC remote executing) daemon.
</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="#AREXEC.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="AREXEC.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="#AREXEC.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"><a href="#AREXEC.RMTLOCNAME"><b>RMTLOCNAME</b></a></td>
<td valign="top">Remote location</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Required, Positional 2</td>
</tr>
<tr>
<td valign="top"><a href="#AREXEC.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="#AREXEC.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="#AREXEC.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="#AREXEC.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="#AREXEC.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="#AREXEC.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="AREXEC.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="#AREXEC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="AREXEC.RMTLOCNAME"></a>
<h3>Remote location (RMTLOCNAME)</h3>
<p>Specifies the remote location to connect with. Specify the remote location name using the format nnnnnnnn.cccccccc, where nnnnnnnn is the network identifier (ID) and cccccccc is the remote location name. If only the remote location name is specified, the local network ID (LCLNETID) network attribute is used as the value of the network identifier (ID).
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#AREXEC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="AREXEC.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="#AREXEC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="AREXEC.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. The password may or may not be substituted across the communication line depending on whether the remote system supports password substitution.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#AREXEC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="AREXEC.MODE"></a>
<h3>Mode (MODE)</h3>
<p>Specifies the name of the mode to be used for the APPC conversation.
</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="#AREXEC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="AREXEC.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="#AREXEC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="AREXEC.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="#AREXEC.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="AREXEC.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="#AREXEC.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="AREXEC.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>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#AREXEC.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>