ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahz_5.4.0.1/system.htm

194 lines
6.0 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8">
<title>system - Run CL command</title>
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</HEAD>
<body bgcolor="#FFFFFF">
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h2>system - Run CL command</h2>
<strong>Synopsis</strong>
<p>
<strong>system [-iKknpqsv]</strong> <em>CLcommand</em> [ <em>arg
...</em> ]
</p>
<p><strong>Description</strong></p>
<p>The <strong>system</strong> utility runs a CL command. Any spool file output
generated by <em>CLcommand</em> is written to standard output. By
default, the spool files are deleted after they are written and the
job log of the job running <strong>system</strong> is deleted.</p>
<p>Any messages generated by <em>CLcommand</em> are written to
standard error. By default, all messages generated by <em>
CLcommand</em> are written using the following format:</p>
<pre>
MsgId: Text
</pre>
<p>where &quot;MsgId&quot; is the seven character i5/OS<SUP>(TM)</SUP> message identifier
(for example CPF0001) and &quot;Text&quot; is the text of the message.
Use the <strong>-n</strong> option to not include the &quot;MsgId&quot; prefix.</p>
<p>By default, <strong>system</strong> checks the number of threads
running in the job. If there is more than one thread running, it
starts a second job and runs <em>CLcommand</em> in the second job.
Use the <strong>-i</strong> option to force <strong>system</strong> to always run
<em>CLcommand</em> in the current job.
</p>
<p><strong>Options</strong></p>
<dl>
<dt><strong>-i</strong></dt>
<dd>Always run <em>CLcommand</em> in the current job and set the exit status
to the ILE return code of the program called by <em>CLcommand</em>. Note
that some CL commands do not run in a multi-thread capable job or when there
are multiple threads running in the job.
</dd>
<dt><strong>-K</strong></dt>
<dd>Keep all spool files generated by <em>CLcommand</em> and the
job log of the job running <strong>system</strong>. If this option is
not specified, all spool files are deleted after they are written and
the job log is deleted.</dd>
<dt><strong>-k</strong></dt>
<dd>Keep all spool files generated by <em>CLcommand</em>. If this option
is not specified, all spool files are deleted after they are written.</dd>
<dt><strong>-n</strong></dt>
<dd>Do not include the message identifier when writing the messages
to standard error. Only the message text of the messages are written
to standard error. This option is ignored if the <strong>-q</strong>
option is also specified.</dd>
<dt><strong>-p</strong></dt>
<dd>Only write the messages sent to the program's message
queue by <em>CLcommand</em> to standard error. This option is ignored
if the <strong>-q</strong> option is also specified.</dd>
<dt><strong>-q</strong></dt>
<dd>Do not write messages generated by <em>CLcommand</em> to
standard error.</dd>
<dt><strong>-s</strong></dt>
<dd>Do not write spool files generated by <em>CLcommand</em> to
standard output.</dd>
<dt><strong>-v</strong></dt>
<dd>Write the complete command string to standard output before running it.</dd>
</dl>
<p>
Note that for compatibility with the PASE system utility, <strong>system</strong>
does not return an error if the <strong>-b</strong>, <strong>-e</strong>,
<strong>-E</strong>, <strong>-I</strong>, or <strong>-O</strong> options are
specified, but the options are ignored.
</p>
<p><strong>Operands</strong></p>
<p>Each <em>arg</em> is a parameter to <em>CLcommand</em>. You may need
to enclose <em>CLcommand</em> and <em>args</em> in quotes to
prevent <strong>qsh</strong> from expanding any special characters
in them. Both CL and <strong>qsh</strong> use some of the same
special characters, for example, the asterisk (*) character.</p>
<p><strong>Environment Variables</strong></p>
<p>The <strong>system</strong> utility is affected by the following
environment variables:</p>
<dl>
<dt><strong>QIBM_SYSTEM_ALWMLTTHD</strong></dt>
<dd>Set this environment variable to control how the <strong>
system</strong> utility behaves in a multi-thread capable job. If
the value of the variable is &quot;N&quot;, <strong>system</strong> starts
a new job to run the CL command when the current job is multi-thread
capable even if there is only one thread running in the job. There is
no default value.<p></dd>
<dt><strong>QIBM_SYSTEM_USE_ILE_RC</strong></dt>
<dd>Set this environment variable to control how the <strong>system</strong>
utility sets the exit status. If the value of the variable is &quot;Y&quot;,
<strong>system</strong> sets the exit status to the ILE return code of the
program called by <em>CLcommand</em>, or zero if the program did not set a
return code. There is no default value. The environment variable is ignored
if the <strong>-i</strong> option is specified.
</dd>
</dl>
<p><strong>Exit Status</strong></p>
<ul>
<li>0 when <em>CLcommand</em> is successful</li>
<li>&gt;0 when <em>CLcommand</em> is unsuccessful or when set by the program
called by <em>CLcommand</em></li>
</ul>
<p>
When the <strong>-i</strong> option is specified or the environment variable
QIBM_SYSTEM_USE_ILE_RC=Y is set, <strong>system</strong> sets the exit status
to the ILE return code of the program called by <em>CLcommand</em>, or
zero if the program did not set a return code.
</p>
<p><strong>Related Information</strong></p>
<ul>
<li><a href="../clfinder/finder.htm">CL command finder</a></li>
<li><a href="../rzalc/pase_system.htm">system - Run a CL command for i5/OS<SUP>(TM)</SUP> PASE</a></li>
</ul>
<p><strong>Examples</strong></p>
<ol>
<li>List all of the active jobs:
<pre>
system wrkactjob
</pre>
</li>
<li>Create a test library:
<pre>
system &quot;CRTLIB LIB(TESTDATA) TYPE(*TEST)&quot;
</pre>
</li>
<li>Delete a library and do not write any messages:
<pre>
system -q &quot;DLTLIB LIB(TESTDATA)&quot;
</pre>
</li>
</ol>
</body>
</html>