ibm-information-center/dist/eclipse/plugins/i5OS.ic.rbam6_5.4.0.1/retcs.htm

101 lines
5.0 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Return code summary" />
<meta name="abstract" content="A return code can be returned using the (RTNCDE) parameter on the Retrieve Job Attributes (RTVJOBA) command ." />
<meta name="description" content="A return code can be returned using the (RTNCDE) parameter on the Retrieve Job Attributes (RTVJOBA) command ." />
<meta name="DC.subject" content="return code, summary" />
<meta name="keywords" content="return code, summary" />
<meta name="DC.Relation" scheme="URI" content="crpro.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/rtvjoba.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/rclrsc.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="retcs" />
<meta name="DC.Language" content="en-us" />
<!-- 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. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Return code summary</title>
</head>
<body id="retcs"><a name="retcs"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Return code summary</h1>
<div><p>A return code can be returned using the (RTNCDE) parameter on the <span class="cmdname">Retrieve
Job Attributes (RTVJOBA)</span> command .</p>
<p>The return code is a 5-digit decimal value with no decimal positions (12345.
for example). The decimal value indicates the status of called programs. CL
programs do not set the return code. However, you can retrieve the current
value of the return code as set by another program in a CL program. You can
do this by using the RTNCDE parameter of the <span class="cmdname">Retrieve Job Attributes
(RTVJOBA)</span> command.</p>
<p>The following list summarizes the return codes used by languages supported
on i5/OS™:
</p>
<ul><li>RPG IV programs <p>The return codes sent by the RPG IV compiler are:
</p>
<dl><dt class="dlterm">0</dt>
<dd>When the program is created</dd>
<dt class="dlterm">2</dt>
<dd>When the program is not created</dd>
</dl>
<p>The return codes sent by running RPG IV programs are: </p>
<dl><dt class="dlterm">0</dt>
<dd>When a program is started, or by the CALL operation before a program is
called</dd>
<dt class="dlterm">1</dt>
<dd>When a program ends with LR set on</dd>
<dt class="dlterm">2</dt>
<dd>When a program ends with an error (response of C, D, F, or S to an inquiry
message)</dd>
<dt class="dlterm">3</dt>
<dd>When a program ends because of a halt indicator (H1-H9)</dd>
</dl>
<p>RPG IV return codes are tested only after a CALL: </p>
<ul><li>0 or 1 indicate no error</li>
<li>3 gives an RPG IV status code of 231</li>
<li>Any other value gives an RPG IV status code 202 (call ended in error)</li>
</ul>
<p>The return code cannot be tested directly by the user in the RPG IV
program.</p>
</li>
<li>ILE COBOL/400<sup>®</sup> programs
<p>The return codes sent by running COBOL/400 programs are: </p>
<dl><dt class="dlterm">0</dt>
<dd>By each CALL statement before a program is called</dd>
<dt class="dlterm">2</dt>
<dd>When a program receives a function check (CPF9999) or the generic I/O
exception handler gets control and there is no applicable USE procedure</dd>
</dl>
<p>COBOL/400 programs cannot retrieve these return
codes. A return code value of 2 sends message CBE9001 and runs a Reclaim
Resources (RCLRSC) command with the *ABNORMAL option.</p>
</li>
<li>C/400* programs <p>The current value of the integer return code returned
by the last C/400<sup>®</sup> return
statement in a C/400 program.</p>
</li>
</ul>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="crpro.htm" title="A CL source procedure must be compiled into a module and bound into a program before it can be run.">Compile CL procedures</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../cl/rtvjoba.htm">Retrieve Job Attributes (RTVJOBA) command</a></div>
<div><a href="../cl/rclrsc.htm">Reclaim Resources (RCLRSC) command</a></div>
</div>
</div>
</body>
</html>