77 lines
4.9 KiB
HTML
77 lines
4.9 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="Extracting a field from the format" />
|
|
<meta name="abstract" content="The format section describes where the field that you want is located within the receiver variable." />
|
|
<meta name="description" content="The format section describes where the field that you want is located within the receiver variable." />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnCommon.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnFieldRPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="conQSYSINC.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="listGeneral.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="cmnExtract" />
|
|
<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>Extracting a field from the format</title>
|
|
</head>
|
|
<body id="cmnExtract"><a name="cmnExtract"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Extracting a field from the format</h1>
|
|
<div><p>The format section describes where the field that you want is located
|
|
within the receiver variable.</p>
|
|
<p>An offset is shown in both decimal and hexadecimal. Depending on which
|
|
language you use, either offset may be helpful. For CL and RPG, you would
|
|
normally use the decimal offset. With any offset, it is important to remember
|
|
whether your language works with an offset from a base of 0 or a base of 1.
|
|
The format tables in the APIs are prepared for languages that work from a
|
|
base of 0, but not all languages can use this base. CL and RPG, for example,
|
|
work from a base of 1, so you need to add 1 to the decimal value of each offset.
|
|
The hold on job queue field begins at decimal offset 76, for example. To access
|
|
the information in CL or RPG, you need to address byte 77 within the receiver
|
|
variable.</p>
|
|
<p>Using the format, you can tell that the field after the hold on job queue
|
|
field, output queue name, begins in offset 86. This means that the hold on
|
|
job queue information is in the following location from a CL or RPG perspective:</p>
|
|
<pre> 77 86
|
|
. .
|
|
. .
|
|
XXXXXXXXXX</pre>
|
|
<p>The only possible values for the hold on job queue field are *YES and *NO.
|
|
They are left-justified in the field and the remaining positions are blank.</p>
|
|
<p>Most of the formats provide additional bytes for each field to allow for
|
|
expansion, such as a new value for the hold on job queue field that would
|
|
be more than 4 bytes.</p>
|
|
<p>Many of the needed structures are provided by the system-include library,
|
|
QSYSINC. However, any fields of a structure that are variable in length are
|
|
not defined by QSYSINC. These variable-length fields must be defined by the
|
|
user, as shown by (3) in Example in OPM RPG: Accessing a field value (initial
|
|
library list).</p>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <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="relconcepts"><strong>Related concepts</strong><br />
|
|
<div><a href="conQSYSINC.htm" title="The QSYSINC (system include) library provides all source includes for APIs shipped with i5/OS.">Include files and the QSYSINC library</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="cmnFieldRPG.htm" title="This sample program shows the correct way of using the offset in a user space in RPG.">Example in OPM RPG: Accessing a field value (initial library list)</a></div>
|
|
<div><a href="listGeneral.htm" title="Describes some of the more important fields that comprise the general data structure.">List Object API general data structure</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |