ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/unix1a.htm

102 lines
6.2 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">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>Environment Variable APIs</title>
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Begin Header Records ========================================== -->
<!-- UNIX1 SCRIPT A converted by B2H R4.1 (346) (CMS) by V2DCIJB at -->
<!-- RCHVMW2 on 1 Jun 1999 at 16:17:47 -->
<!-- file cleaned -->
<!-- 031112 JETAYLOR replaced API and/or Exit listings with -->
<!-- pagegenerator output from javascript array -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<a name="Top_Of_Page"></a>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<h2>Environment Variable APIs</h2>
<p><strong>Environment variables</strong> are character strings of the form
"name=value". There are two types of environment variables:</p>
<ul>
<li>Job-level environment variables. The job-level environment variables are
stored in an environment space outside of the program associated with the job.
They can be manipulated by using the <strong>getenv()</strong>, <strong>
putenv()</strong>, <strong>Qp0zDltEnv()</strong>, <strong>
Qp0zGetEnv()</strong>, <strong>Qp0zInitEnv()</strong>, and <strong>
Qp0zPutEnv()</strong> APIs, as well as the CL commands ADDENVVAR, CHGENVVAR,
RMVENVVAR, and WRKENVVAR. These variables exist for the duration of the job or
until they are deleted. There is a limit of 4095 job-level environment
variables.<br>
<br>
</li>
<li>System-level environment variables. The system-level environment variables
are stored in a global environment space that is persistent across IPLs and is
not associated to a particular job. They can be manipulated by using the
<strong>Qp0zDltSysEnv()</strong>, <strong>Qp0zGetAllSysEnv()</strong>, <strong>
Qp0zGetSysEnv()</strong>, and <strong>Qp0zPutSysEnv()</strong> APIs, as well as
the CL commands ADDENVVAR, CHGENVVAR, RMVENVVAR, and WRKENVVAR. These variables
exist until they are deleted. There is a limit of 4095 system-level environment
variables.</li>
</ul>
<p>When a job calls one of the job-level environment variable APIs or CL
commands for the first time, it inherits the system-level environment variables
onto its job-level environment space. Any changes to job-level and system-level
environment variables are then independent of one another.</p>
<p>The temporary space where the job-level environment variables are stored
allows read and write access. Therefore, it is possible for the space to be
corrupted. This could occur if a programmer accesses the space directly using
the <samp>environ</samp> array rather than using the environment variable APIs.
If the space is corrupted, subsequent calls using the APIs will have
unpredictable results.</p>
<p>The environment variable APIs are:</p>
<!-- ***** NOTE ***** Do not manually update text or links in this section. -->
<!-- Updates made in this section *will* be overlaid by automated tools -->
<!-- Notify User Technologies of needed updates to be made in XML for API finder.-->
<!--***************API BEGIN PASTE***************-->
<ul>
<li><A HREF="evgetenv.htm">getenv()</A> (Get value of environment variable) searches the job-level environment list for a string of the form name=value, where name is the environment variable and value is the value of the variable.</li>
<li><A HREF="evputenv.htm">putenv()</A> (Change or add environment variable) sets the value of a job-level environment variable by changing an existing variable or creating a new one.</li>
<li><A HREF="evdltenv.htm">Qp0zDltEnv()</A> (Delete an environment variable) deletes a single job-level environment variable or deletes all environment variables from the current job.</li>
<li><A HREF="evdltsev.htm">Qp0zDltSysEnv()</A> (Delete a system-level environment variable) deletes a single system-level environment variable or deletes all system-level environment variables.</li>
<li><A HREF="evgetall.htm">Qp0zGetAllSysEnv()</A> (Get all system-level environment variables) fills in the list_buf with a list of all the system-level environment variables.</li>
<li><A HREF="evgenvxt.htm">Qp0zGetEnv()</A> (Get value of environment variable (extended)) is an i5/OS extension to the standard getenv() function.</li>
<li><A HREF="evgetsev.htm">Qp0zGetSysEnv()</A> (Get value of system-level environment variable) gets the value of a system-level environment variable name by searching the system-level environment variable list for a string of the form name=value.</li>
<li><A HREF="evinenv.htm">Qp0zInitEnv()</A> (Initialize environment for variables) sets the external variable environ to a pointer to the current environment list.</li>
<li><A HREF="evpenvxt.htm">Qp0zPutEnv()</A> (Change or add environment variable (extended)) is an i5/OS extension to the standard putenv() function.</li>
<li><A HREF="evputsev.htm">Qp0zPutSysEnv()</A> (Change or add a system-level environment variable) sets the value of a system-level environment variable by altering an existing variable or creating a new variable.</li>
</ul>
<!--***************API END PASTE***************-->
<p><strong>Note:</strong> These functions use header (include) files from the
library QSYSINC, which is optionally installable. Make sure QSYSINC is
installed on your system before using any of the functions. See <a href=
"unix13.htm">Header Files for UNIX-Type Functions</a> for the file and member
name of each header file.</p>
<hr>
<table cellpadding="2" cellspacing="2" align="center">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</body>
</html>