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

248 lines
9.0 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>Add Environment Variable (ADDENVVAR)</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="ADDENVVAR.Top_Of_Page"></a>
<h2>Add Environment Variable (ADDENVVAR)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>Yes
</td>
<td valign="top" align="right">
<a href="#ADDENVVAR.PARAMETERS.TABLE">Parameters</a><br>
<a href="#ADDENVVAR.COMMAND.EXAMPLES">Examples</a><br>
<a href="#ADDENVVAR.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="ADDENVVAR"></a>
<p>The Add Environment Variable (ADDENVVAR) command adds an environment variable consisting of a character string in the form 'environment variable name=environment variable value'. Environment variables can be used, for example, to specify configuration values to application programs on systems that are compliant with the Single UNIX Specification.
</p>
<p>If you are not ready to set the environment variable value, you can use this command to add an environment variable with a null value. You can then use the Add Environment Variable (ADDENVVAR) or Change Environment Variable (CHGENVVAR) command to associate the environment value with the environment variable name.
</p>
<p><b>Restriction:</b> You must have *JOBCTL special authority to use this command to add system-level environment variables.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDENVVAR.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="ADDENVVAR.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="#ADDENVVAR.ENVVAR"><b>ENVVAR</b></a></td>
<td valign="top">Environment variable</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Required, Positional 1</td>
</tr>
<tr>
<td valign="top"><a href="#ADDENVVAR.VALUE"><b>VALUE</b></a></td>
<td valign="top">Initial value</td>
<td valign="top"><i>Character value</i>, <b><u>*NULL</u></b></td>
<td valign="top">Optional, Positional 2</td>
</tr>
<tr>
<td valign="top"><a href="#ADDENVVAR.CCSID"><b>CCSID</b></a></td>
<td valign="top">Coded character set ID</td>
<td valign="top">1-65535, <b><u>*JOB</u></b>, *HEX</td>
<td valign="top">Optional, Positional 3</td>
</tr>
<tr>
<td valign="top"><a href="#ADDENVVAR.LEVEL"><b>LEVEL</b></a></td>
<td valign="top">Level</td>
<td valign="top"><b><u>*JOB</u></b>, *SYS</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#ADDENVVAR.REPLACE"><b>REPLACE</b></a></td>
<td valign="top">Replace existing entry</td>
<td valign="top"><b><u>*NO</u></b>, *YES</td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#ADDENVVAR.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="ADDENVVAR.ENVVAR"></a>
<h3>Environment variable (ENVVAR)</h3>
<p>Specifies the name of the environment variable to be added. If an environment variable by this name currently exists at the specified level (LEVEL parameter), error message CPFA980 is issued, unless the REPLACE(*YES) option is used, in which case the variable is set to the new value specified.
</p>
<p>ADDENVVAR limits environment variable name to a maximum of 128 bytes in length. Valid values include all EBCDIC characters except the equal sign (=), the null-terminator (X'00') and blank (X'40'). The name must be enclosed in apostrophes if it contains any non-alphanumeric character. If an apostrophe is intended, two apostrophes must be used ('').
</p>
<p>
<b>Note: </b>The case is preserved when lowercase characters are specified.
</p>
<p>This is a required parameter.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDENVVAR.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDENVVAR.VALUE"></a>
<h3>Initial value (VALUE)</h3>
<p>Specifies the environment variable value.
</p>
<p>The possible values are:
</p>
<dl>
<dt><b><u>*NULL</u></b></dt>
<dd>The value of the environment variable is the null character (X'00').
</dd>
<dt><b><i>environment-variable-value</i></b></dt>
<dd>Specify the value of the environment variable. ADDENVVAR limits value to a maximum of 1024 bytes in length. Valid values include all EBCDIC characters. The value must be enclosed in apostrophes if it contains any non-alphanumeric character or blanks. If an apostrophe is intended, two apostrophes must be used ('').
</dd>
</dl>
<p>
<b>Note: </b>The case is preserved when lowercase characters are specified.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDENVVAR.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDENVVAR.CCSID"></a>
<h3>Coded character set ID (CCSID)</h3>
<p>Specifies the coded character set identifier (CCSID) of the text supplied on the ENVVAR and the VALUE parameters. This value is stored with the environment variable.
</p>
<p>The possible values are:
</p>
<dl>
<dt><b><u>*JOB</u></b></dt>
<dd>The CCSID of the text is assumed to be the CCSID of the job running this command.
</dd>
<dt><b>*HEX</b></dt>
<dd>The CCSID of 65535 is stored with this environment variable.
</dd>
<dt><b><i>coded-character-set-identifier</i></b></dt>
<dd>Specify the CCSID to be stored with the environment variable. Valid values range from 1 through 65535.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDENVVAR.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDENVVAR.LEVEL"></a>
<h3>Level (LEVEL)</h3>
<p>Specifies the level of the environment variable.
</p>
<p>The possible values are:
</p>
<dl>
<dt><b><u>*JOB</u></b></dt>
<dd>This is a job-level environment variable.
</dd>
<dt><b>*SYS</b></dt>
<dd>This is a system-level environment variable.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDENVVAR.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDENVVAR.REPLACE"></a>
<h3>Replace existing entry (REPLACE)</h3>
<p>Specifies whether the value of an existing environment variable should be reset to the new value.
</p>
<p>The possible values are:
</p>
<dl>
<dt><b><u>*NO</u></b></dt>
<dd>Do not replace. If an environment variable with the specified name (ENVVAR parameter) exists at the specified level (LEVEL parameter), error message CPFA980 is issued.
</dd>
<dt><b>*YES</b></dt>
<dd>Replace. If an environment variable with the specified name (ENVVAR parameter) exists at the specified level (LEVEL parameter), its value will be replaced by the new value.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDENVVAR.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="ADDENVVAR.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Add an Environment Variable with CCSID 37</b>
</p>
<p>
<pre>
ADDENVVAR ENVVAR(altdir) VALUE('/mydir/dir2') CCSID(37)
</pre>
</p>
<p>This command adds the environment variable named altdir with the value /mydir/dir2 to the environment variables for the job. The value 37 is stored with the environment variable to indicate its CCSID.
</p>
<p><b>Example 2: Set an Environment Variable to Null</b>
</p>
<p>
<pre>
ADDENVVAR ENVVAR(LIBPATH) VALUE(*NULL)
</pre>
</p>
<p>This command adds the environment variable named LIBPATH with the null (x'00) character value to the environment variables for the job.
</p>
<p><b>Example 3: Add a System-level Environment Variable</b>
</p>
<p>
<pre>
ADDENVVAR ENVVAR(homedir) VALUE('/home') LEVEL(*SYS)
</pre>
</p>
<p>This command adds a system-level environment variable named homedir with value /home.
</p>
<p><b>Example 4: Reset a Job-level Environment Variable</b>
</p>
<p>
<pre>
ADDENVVAR ENVVAR(altdir) VALUE('/mydir/dir3') REPLACE(*YES)
</pre>
</p>
<p>This command replaces the existing value of the variable altdir with the new value of /mydir/dir3.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDENVVAR.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="ADDENVVAR.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPFA980</b></dt>
<dd>Environment variable name exists.
</dd>
<dt><b>CPFA982</b></dt>
<dd>ENVVAR character not valid.
</dd>
<dt><b>CPFA983</b></dt>
<dd>Unexpected error occurred.
</dd>
<dt><b>CPFA984</b></dt>
<dd>Maximum number of environment variables exist.
</dd>
<dt><b>CPFA98E</b></dt>
<dd>*JOBCTL special authority required to update system-level environment variables.
</dd>
<dt><b>CPF3BCA</b></dt>
<dd>CCSID &amp;1 not supported.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDENVVAR.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>