69 lines
3.7 KiB
HTML
69 lines
3.7 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="reference" />
|
|
<meta name="DC.Title" content="Example: Retrieve data area ORDINFO" />
|
|
<meta name="abstract" content="This is an example of using a data area to track the status of an order file." />
|
|
<meta name="description" content="This is an example of using a data area to track the status of an order file." />
|
|
<meta name="DC.subject" content="example, retrieving, data area" />
|
|
<meta name="keywords" content="example, retrieving, data area" />
|
|
<meta name="DC.Relation" scheme="URI" content="excop.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="daex1" />
|
|
<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>Example: Retrieve data area ORDINFO</title>
|
|
</head>
|
|
<body id="daex1"><a name="daex1"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Example: Retrieve data area ORDINFO</h1>
|
|
<div><p>This is an example of using a data area to track the status of
|
|
an order file.</p>
|
|
<div class="section"><p>Assume that you are using a data area named ORDINFO to track the
|
|
status of an order file. This data area is designed so that:</p>
|
|
<ul><li>Position 1 contains an O (open), a P (processing), or a C (complete).</li>
|
|
<li>Position 2 contains an I (in-stock) or an O (out-of-stock).</li>
|
|
<li>Positions 3 through 5 contain the initials of the order clerk.</li>
|
|
</ul>
|
|
<p>You would declare these fields in your procedure as follows:</p>
|
|
<pre>DCL VAR(&ORDSTAT) TYPE(*CHAR) LEN(1)
|
|
DCL VAR(&STOCKC) TYPE(*CHAR) LEN(1)
|
|
DCL VAR(&CLERK) TYPE(*CHAR) LEN(3)</pre>
|
|
</div>
|
|
<div class="section"><p>To retrieve the order status into &ORDSTAT, you would enter
|
|
the following: </p>
|
|
<pre>RTVDTAARA DTAARA(ORDINFO (1 1)) RTNVAR(&ORDSTAT)</pre>
|
|
</div>
|
|
<div class="section"><p>To retrieve the stock condition into &STOCK, you would enter
|
|
the following: </p>
|
|
<pre>RTVDTAARA DTAARA(ORDINFO (2 1)) RTNVAR(&STOCKC)</pre>
|
|
</div>
|
|
<div class="section"><p>To retrieve the clerk's initials into &CLERK, you would enter
|
|
the following:</p>
|
|
<pre>RTVDTAARA DTAARA(ORDINFO (3 3)) RTNVAR(&CLERK)</pre>
|
|
<p>Each use of the RTVDTAARA command requires the data area to
|
|
be accessed. If you are retrieving many subfields, it is more efficient to
|
|
retrieve the entire data area into a variable, then use the substring built-in
|
|
function to extract the subfields.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="excop.htm" title="These examples show different ways of retrieving a data area.">Examples: Retrieve a data area</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |