ibm-information-center/dist/eclipse/plugins/i5OS.ic.apiref_5.4.0.1/data.htm

68 lines
4.0 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?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="Data types" />
<meta name="abstract" content="APIs support character data and binary data." />
<meta name="description" content="APIs support character data and binary data." />
<meta name="DC.Relation" scheme="URI" content="concept.htm" />
<meta name="DC.Relation" scheme="URI" content="cmnRetrieveRPG.htm" />
<meta name="DC.Relation" scheme="URI" content="pgmerr_datas.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="data" />
<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>Data types</title>
</head>
<body id="data"><a name="data"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Data types</h1>
<div><p>APIs support character data and binary data.</p>
<div class="section"><h4 class="sectiontitle">Character data</h4><p>In the API parameter
tables, CHAR(*) represents character data that has:</p>
<ul><li>A type that is not known, such as character, binary, and so on</li>
<li>A length that might not be known or is based on another value (for example,
a length you specify)</li>
</ul>
</div>
<div class="section"><h4 class="sectiontitle">Binary data</h4><p>In the API parameter tables, BINARY(2)
and BINARY(4) represent numeric data. These parameters must be signed, 2-
or 4-byte numeric values with a precision of 15 (halfword) or 31 (fullword)
bits and one high-order bit for the sign. Numeric parameters that must be
unsigned 4-byte numeric values are explicitly defined as BINARY(4) UNSIGNED.</p>
<p>When
you develop applications that use binary values, be aware that some high-level
languages allow the definition of binary variables by using precision and
not length. For example, an RPG definition of binary length 4 specifies a
precision of 4 digits, which can be stored in a 2-byte binary field. For API
BINARY(4) fields, RPG developers should use one of the following:</p>
<ul><li>Positional notation</li>
<li>A length of 5 to 9 in order to allocate a 4-byte binary field</li>
<li>A length of 10 in order to allocate a 4-byte integer field</li>
</ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="concept.htm" title="Describes the underlying concepts that you need to understand to work effectively with APIs. Among the concepts covered are basic concepts, programming considerations, and terminology.">API concepts</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="cmnRetrieveRPG.htm" title="This sample program shows exceptions being returned in the error code parameter.">Example in OPM RPG: Retrieving the HOLD parameter (error code structure)</a></div>
<div><a href="pgmerr_datas.htm" title="When a data structure is defined for use with an API, the structure must be built to receive what the API returns.">Define data structures</a></div>
</div>
</div>
</body>
</html>