147 lines
4.7 KiB
HTML
147 lines
4.7 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>Change COBOL Main Program (QLRCHGCM) API</title>
|
||
|
<!-- Begin Header Records ========================================== -->
|
||
|
<!-- 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. -->
|
||
|
<!-- NETMG2 SCRIPT A converted by B2H R4.1 (346) (CMS) by HOLTJM at -->
|
||
|
<!-- RCHVMW2 on 29 Jan 1999 at 10:01:37 -->
|
||
|
<!-- Change History: -->
|
||
|
<!-- YYMMDD USERID Change description -->
|
||
|
<!--File Edited by Kersten Oct 2001 -->
|
||
|
<!--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 language="Javascript" src="../rzahg/synch.js" type="text/javascript">
|
||
|
</script>
|
||
|
|
||
|
<h2>Change COBOL Main Program (QLRCHGCM) API</h2>
|
||
|
|
||
|
<div class="box" style="width: 60%;">
|
||
|
<br>
|
||
|
Required Parameter<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
<table width="100%">
|
||
|
|
||
|
<tr>
|
||
|
<td align="center" valign="top" width="10%">1</td>
|
||
|
<td align="left" valign="top" width="50%">Error code</td>
|
||
|
<td align="left" valign="top" width="20%">I/O</td>
|
||
|
<td align="left" valign="top" width="20%">Char(*)</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<br>
|
||
|
Default Public Authority: *USE<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Threadsafe: No<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
</div>
|
||
|
|
||
|
<p>The Change COBOL Main Program (QLRCHGCM) API allows you to create an
|
||
|
additional run unit by assigning a different System/36-compatible COBOL,
|
||
|
System/38-compatible COBOL, or iSeries OPM COBOL/400 program to serve as a main
|
||
|
program. You can call it from any programming language.</p>
|
||
|
|
||
|
<p><strong>Note:</strong> By creating more than one run unit, you cantreat
|
||
|
files, storage, and error conditions differently than you would using an
|
||
|
ordinary subprogram.</p>
|
||
|
|
||
|
<p>After you call this API, the next nonactive COBOL program that runs becomes
|
||
|
the main program in a new run unit. An active COBOL program is a program that
|
||
|
has been called, and is not in its initial state.</p>
|
||
|
|
||
|
<p>In the following example, System/38-compatible COBOL Program A calls iSeries
|
||
|
COBOL/400 Program B. Because Program A is the first COBOL program, it is the
|
||
|
main COBOL program.</p>
|
||
|
|
||
|
<p>COBOL Program B is a menu program that calls CL Program C.</p>
|
||
|
|
||
|
<p>Program C must start a new COBOL application that will pass control back to
|
||
|
it, regardless of error conditions. To accomplish this, Program C calls the
|
||
|
QLRCHGCM API before calling the new COBOL application.</p>
|
||
|
|
||
|
<p>When program C calls the new COBOL application in the form of Program D,
|
||
|
Program D becomes the main program in a new run unit. When Program D's run unit
|
||
|
ends, control returns to the original run unit, and Program A becomes the
|
||
|
current main program again.</p>
|
||
|
|
||
|
<p>If, at the time a run unit is created, a program is active as a subprogram
|
||
|
in an existing run unit, and this program is then called within the new run
|
||
|
unit, it will be made available in its last-used state.</p>
|
||
|
|
||
|
<p><img src="RBAFX514.gif" alt="Graphical depiction of the preceding text"></p>
|
||
|
|
||
|
<br>
|
||
|
<!-- Please NOTE: DO NOT DELETE THIS SECTION if this API has no authorities and locks. -->
|
||
|
<!-- Instead, use the commented out coding below to indicate NONE. -->
|
||
|
<h3>Authorities and Locks</h3>
|
||
|
|
||
|
<!-- Use this if there are no authorities and locks. -->
|
||
|
<p>None.</p>
|
||
|
|
||
|
<br>
|
||
|
<h3>Required Parameter</h3>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong>Error code</strong></dt>
|
||
|
|
||
|
<dd>I/O; CHAR(*)
|
||
|
|
||
|
<p>The structure in which to return error information. For the format of the
|
||
|
structure, see <a href="../apiref/error.htm#hdrerrcod">Error Code Parameter</a>.</p>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<h3>Error Messages</h3>
|
||
|
|
||
|
<table cellpadding="5">
|
||
|
<!-- cols="15 85" -->
|
||
|
<tr>
|
||
|
<th align="left" valign="top" nowrap>Message ID</th>
|
||
|
<th align="left" valign="top">Error Message Text</th>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top">CPF3C90 E</td>
|
||
|
<td align="left" valign="top">Literal value cannot be changed.</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td valign="top">LBE7040 E</td>
|
||
|
<td valign="top">Format of error code parameter is not correct.</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<hr>
|
||
|
API introduced: V2R2
|
||
|
|
||
|
<hr>
|
||
|
<table align="center" cellpadding="2" cellspacing="2">
|
||
|
<tr align="center"><td valign="middle" align="center">
|
||
|
<a href="#Top_Of_Page">Top</a> |
|
||
|
<a href="hll.htm">High-level language APIs</a> |
|
||
|
<a href="aplist.htm">APIs by category</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</body>
|
||
|
</html>
|
||
|
|