159 lines
13 KiB
HTML
159 lines
13 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="Scenario: Original Program Model (OPM) API" />
|
|
<meta name="abstract" content="This scenario demonstrates the use of an original program model (OPM) API in several different programs." />
|
|
<meta name="description" content="This scenario demonstrates the use of an original program model (OPM) API in several different programs." />
|
|
<meta name="DC.Relation" scheme="URI" content="apiUse.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnHoldRPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnHoldCOBOL.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnHoldILEC.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnHoldILERPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnRetrieveRPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnRetrieveCOBOL.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnRetrieveILEC.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnRetrieveILERPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnAccessRPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnAccessCOBOL.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnAccessILEC.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnAccessILERPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnFieldRPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnFieldCOBOL.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnFieldILEC.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnFieldILERPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnKeysRPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnKeysCOBOL.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnKeysILEC.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnKeysILERPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="opmOverview.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="conVerbs.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="../apis/qwdrjobd.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnCommon.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="opmScenario" />
|
|
<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>Scenario: Original Program Model (OPM) API</title>
|
|
</head>
|
|
<body id="opmScenario"><a name="opmScenario"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Scenario: Original Program Model (OPM) API</h1>
|
|
<div><p>This scenario demonstrates the use of an original program model
|
|
(OPM) API in several different programs. </p>
|
|
<p>These examples focus on descriptions, formats, variable-length fields as
|
|
output, and optional parameters. This scenario accesses information from a
|
|
job description to demonstrate how to code APIs. While this may not be what
|
|
your application requires, you can use the same approach to access information
|
|
when you use most of the APIs.</p>
|
|
<p>Assume that you are interested in accessing the value of the hold parameter
|
|
on the Retrieve Job Description (RTVJOBD) command. The hold parameter determines
|
|
whether the job is held on the job queue. Two values are supported:</p>
|
|
<p><strong>*NO</strong> The job is not held.</p>
|
|
<p><strong>*YES</strong> The job is held on the job queue.</p>
|
|
<p>The first step is to find the correct API to use. To do this, you must
|
|
identify the part of the <span class="keyword">i5/OS™</span>program
|
|
that is most closely related to the function in which you are interested.
|
|
If you want to access information from a job description, as in our scenario,
|
|
you should know that a job description object is considered part of the work
|
|
management function.</p>
|
|
<p>API names contain verbs that are similar to the <span class="keyword">i5/OS</span> licensed
|
|
program: change, create, remove, and retrieve. For a complete list of verbs,
|
|
see OPM and ILE API verbs and abbreviations.</p>
|
|
<p>These examples use the Retrieve Job Description Information (QWDRJOBD)
|
|
API.</p>
|
|
<p>For a detailed description of how to use the API, use information in API
|
|
information format.</p>
|
|
<div class="note"><span class="notetitle">Note:</span> These descriptions and the programs that support them are in RPG. You
|
|
can, however, view the same programs in different languages.</div>
|
|
<p>IBM<sup>®</sup> grants
|
|
you a nonexclusive copyright license to use all programming code examples
|
|
from which you can generate similar function tailored to your own specific
|
|
needs.</p>
|
|
<p><img src="./delta.gif" alt="Start of change" />SUBJECT TO ANY STATUTORY WARRANTIES WHICH CANNOT BE EXCLUDED, IBM,
|
|
ITS PROGRAM DEVELOPERS AND SUPPLIERS MAKE NO WARRANTIES OR CONDITIONS EITHER
|
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OR
|
|
CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT,
|
|
REGARDING THE PROGRAM OR TECHNICAL SUPPORT, IF ANY. <img src="./deltaend.gif" alt="End of change" /></p>
|
|
<p><img src="./delta.gif" alt="Start of change" />UNDER NO CIRCUMSTANCES IS IBM, ITS PROGRAM DEVELOPERS OR SUPPLIERS
|
|
LIABLE FOR ANY OF THE FOLLOWING, EVEN IF INFORMED OF THEIR POSSIBILITY: <img src="./deltaend.gif" alt="End of change" /></p>
|
|
<img src="./delta.gif" alt="Start of change" /><ol><li>LOSS OF, OR DAMAGE TO, DATA;</li>
|
|
<li>SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES, OR FOR ANY ECONOMIC CONSEQUENTIAL
|
|
DAMAGES; OR </li>
|
|
<li>LOST PROFITS, BUSINESS, REVENUE, GOODWILL, OR ANTICIPATED SAVINGS.</li>
|
|
</ol><img src="./deltaend.gif" alt="End of change" />
|
|
<p><img src="./delta.gif" alt="Start of change" />SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION
|
|
OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO SOME OR ALL OF THE ABOVE LIMITATIONS
|
|
OR EXCLUSIONS MAY NOT APPLY TO YOU.<img src="./deltaend.gif" alt="End of change" /></p>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="cmnHoldRPG.htm">Example in OPM RPG: Retrieving the HOLD parameter (exception message)</a></strong><br />
|
|
This example expects errors to be sent as escape messages.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnHoldCOBOL.htm">Example in ILE COBOL: Retrieving the HOLD parameter (exception message)</a></strong><br />
|
|
This example expects errors sent as escape messages.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnHoldILEC.htm">Example in ILE C: Retrieving the HOLD parameter (exception message)</a></strong><br />
|
|
This example expects errors sent as escape messages.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnHoldILERPG.htm">Example in ILE RPG: Retrieving the HOLD parameter (exception message)</a></strong><br />
|
|
This program retrieves the HOLD value from a job description. It expects errors to be sent as escape messages.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnRetrieveRPG.htm">Example in OPM RPG: Retrieving the HOLD parameter (error code structure)</a></strong><br />
|
|
This sample program shows exceptions being returned in the error code parameter.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnRetrieveCOBOL.htm">Example in ILE COBOL: Retrieving the HOLD parameter (error code structure)</a></strong><br />
|
|
This example shows how to make use of an error returned in the error code structure.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnRetrieveILEC.htm">Example in ILE C: Retrieving the HOLD parameter (error code structure)</a></strong><br />
|
|
This example shows how to make use of an error returned in the error code structure.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnRetrieveILERPG.htm">Example in ILE RPG: Retrieving the HOLD parameter (error code structure)</a></strong><br />
|
|
This program retrieves the HOLD value from a job description. It expects errors to be returned via the error code parameter.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnAccessRPG.htm">Example in OPM RPG: Accessing the HOLD attribute</a></strong><br />
|
|
The following program prints out the name of the job description or prints an error if the API could not find the job description name specified.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnAccessCOBOL.htm">Example in ILE COBOL: Accessing the HOLD attribute</a></strong><br />
|
|
This example shows how to print messages to spool files.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnAccessILEC.htm">Example in ILE C: Accessing the HOLD attribute</a></strong><br />
|
|
This example shows how to print messages to spool files.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnAccessILERPG.htm">Example in ILE RPG: Accessing the HOLD attribute</a></strong><br />
|
|
This program retrieves the HOLD value from a job description and then prints the value. It expects errors to be returned via the error code parameter.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnFieldRPG.htm">Example in OPM RPG: Accessing a field value (initial library list)</a></strong><br />
|
|
This sample program shows the correct way of using the offset in a user space in RPG.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnFieldCOBOL.htm">Example in ILE COBOL: Accessing a field value (initial library list)</a></strong><br />
|
|
This example shows how to access a field value returned from a retrieve API.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnFieldILEC.htm">Example in ILE C: Accessing a field value (initial library list)</a></strong><br />
|
|
This example shows how to access a field value returned from a retrieve API.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnFieldILERPG.htm">Example in ILE RPG: Accessing a field value (initial library list)</a></strong><br />
|
|
This program retrieves the library list from a job description. It expects errors to be returned via the error code parameter.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnKeysRPG.htm">Example in OPM RPG: Using keys with List Spooled Files API</a></strong><br />
|
|
This example shows the steps necessary to process keyed output from an API.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnKeysCOBOL.htm">Example in ILE COBOL: Using keys with List Spooled Files API</a></strong><br />
|
|
This example shows the steps necessary to process keyed output from an API.</li>
|
|
<li class="ulchildlink"><strong><a href="cmnKeysILEC.htm">Example in ILE C: Using keys with List Spooled Files API</a></strong><br />
|
|
This example shows the steps necessary to process keyed output from an API</li>
|
|
<li class="ulchildlink"><strong><a href="cmnKeysILERPG.htm">Example in ILE RPG: Using keys with List Spooled Files API</a></strong><br />
|
|
This example shows the steps necessary to process keyed output from an API.</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="apiUse.htm" title="Provides scenarios for and practical application of using APIs.">Using APIs</a></div>
|
|
</div>
|
|
<div class="relconcepts"><strong>Related concepts</strong><br />
|
|
<div><a href="opmOverview.htm" title="This topic describes the naming conventions of Original Program Model (OPM) APIs, the initial APIs on the system.">APIs for the Original Program Model environment</a></div>
|
|
<div><a href="cmnCommon.htm" title="API names contain verbs that are similar to the i5/OS licensed program: change, create, remove, and retrieve.">API information format</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="conVerbs.htm" title="The two to three letters following the APIs make up an internal component identifier. The last part of the API name identifies the action or function of the API. The information after the component ID is an abbreviation of the verb that describes the function of the API.">OPM and ILE API verbs and abbreviations</a></div>
|
|
<div><a href="../apis/qwdrjobd.htm">Retrieve Job Description Information (QWDRJOBD)</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |