180 lines
13 KiB
HTML
180 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="reference" />
|
||
|
<meta name="DC.Title" content="Data area" />
|
||
|
<meta name="abstract" content="The DataArea class is an abstract base class that represents an iSeries data area object" />
|
||
|
<meta name="description" content="The DataArea class is an abstract base class that represents an iSeries data area object" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="dataarea" />
|
||
|
<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 area</title>
|
||
|
</head>
|
||
|
<body id="dataarea"><a name="dataarea"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Data area</h1>
|
||
|
<div><p>The DataArea class is an abstract base class that represents an iSeries™ data
|
||
|
area object</p>
|
||
|
<div class="section"><p><a href="javadoc/com/ibm/as400/access/DataArea.html"> DataArea</a> </p>
|
||
|
<p>This base class has four subclasses
|
||
|
that support the following: character data, decimal data, logical data, and
|
||
|
local data areas that contain character data.</p>
|
||
|
<p>Using the DataArea class,
|
||
|
you can do the following:</p>
|
||
|
<ul><li>Get the <a href="javadoc/com/ibm/as400/access/DataArea.html#GETLENGTH()">size</a> of the data area</li>
|
||
|
<li>Get the <a href="javadoc/com/ibm/as400/access/DataArea.html#GETNAME()">name</a> of the data area</li>
|
||
|
<li>Return the <a href="javadoc/com/ibm/as400/access/DataArea.html#GETSYSTEM()">AS400 system object</a> for the data area</li>
|
||
|
<li>Refresh the <a href="javadoc/com/ibm/as400/access/DataArea.html#REFRESHATTRIBUTES()"> attributes</a> of the data area</li>
|
||
|
<li>Set the <a href="javadoc/com/ibm/as400/access/DataArea.html#SETSYSTEM(COM.IBM.AS400.ACCESS.AS400)"> system</a> where the data area exists</li>
|
||
|
</ul>
|
||
|
<p>Using the DataArea class causes the AS400 object to connect to the
|
||
|
server. See <a href="mngcon.htm#mngcon">managing connections</a> for
|
||
|
information on managing connections.</p>
|
||
|
</div>
|
||
|
<div class="section" id="dataarea__chardataarea"><a name="dataarea__chardataarea"><!-- --></a><h4 class="sectiontitle">CharacterDataArea</h4><p>The <a href="javadoc/com/ibm/as400/access/CharacterDataArea.html"> CharacterDataArea</a> class
|
||
|
represents a data area on the server that contains character data. Character
|
||
|
data areas do not have a facility for tagging the data with the proper CCSID;
|
||
|
therefore, the data area object assumes that the data is in the user's CCSID.
|
||
|
When writing, the data area object converts from a string (Unicode) to the
|
||
|
user's CCSID before writing the data to the server. When reading, the data
|
||
|
area object assumes that the data is the CCSID of the user and converts from
|
||
|
that CCSID to Unicode before returning the string to the program. When reading
|
||
|
data from the data area, the amount of data read is by number of characters,
|
||
|
not by the number of bytes.</p>
|
||
|
<p>Using the CharacterDataArea class, you can
|
||
|
do the following:</p>
|
||
|
<ul><li><a href="javadoc/com/ibm/as400/access/CharacterDataArea.html#CLEAR()"> Clear</a> the data area so that it contains all blanks.</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/CharacterDataArea.html#CREATE()"> Create</a> a character data area on the system using default
|
||
|
property values</li>
|
||
|
<li>Create a character data area with <a href="javadoc/com/ibm/as400/access/CharacterDataArea.html#CREATE(INT, JAVA.LANG.STRING, JAVA.LANG.STRING, JAVA.LANG.STRING)"> specific attributes</a></li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/CharacterDataArea.html#DELETE()"> Delete</a> the data area from the system where the data
|
||
|
area exists</li>
|
||
|
<li>Return the <a href="javadoc/com/ibm/as400/access/CharacterDataArea.html#GETPATH()"> integrated file system path name</a> of the object represented
|
||
|
by the data area.</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/CharacterDataArea.html#READ()"> Read</a> all of the data that is contained in the data area</li>
|
||
|
<li>Read a <a href="javadoc/com/ibm/as400/access/CharacterDataArea.html#READ(INT, INT)"> specified amount</a> of data from the data area starting
|
||
|
at offset 0 or the offset that you specified</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/CharacterDataArea.html#SETPATH(JAVA.LANG.STRING)"> Set</a> the fully qualified integrated file system path
|
||
|
name of the data area</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/CharacterDataArea.html#WRITE(JAVA.LANG.STRING)"> Write</a> data to the beginning of the data area</li>
|
||
|
<li>Write a <a href="javadoc/com/ibm/as400/access/CharacterDataArea.html#WRITE(JAVA.LANG.STRING, INT)"> specified amount</a> of data to the data area starting at
|
||
|
offset 0 or the offset that you specified</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section" id="dataarea__decdataarea"><a name="dataarea__decdataarea"><!-- --></a><h4 class="sectiontitle">DecimalDataArea</h4><p>The <a href="javadoc/com/ibm/as400/access/DecimalDataArea.html#"> DecimalDataArea</a> class
|
||
|
represents a data area on the server that contains decimal data.</p>
|
||
|
<p>Using
|
||
|
the DecimalDataArea class, you can do the following:</p>
|
||
|
<ul><li><a href="javadoc/com/ibm/as400/access/DecimalDataArea.html#CLEAR()"> Clear</a> the data area so that it contains 0.0</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/DecimalDataArea.html#CREATE()"> Create</a> a decimal data area on the system using default
|
||
|
property values</li>
|
||
|
<li>Create a decimal data area with <a href="javadoc/com/ibm/as400/access/DecimalDataArea.html#CREATE(INT, INT, JAVA.MATH.BIGDECIMAL, JAVA.LANG.STRING, JAVA.LANG.STRING)"> specified attributes</a></li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/DecimalDataArea.html#DELETE()"> Delete</a> the data area from the server where the data
|
||
|
area exists</li>
|
||
|
<li>Return the <a href="javadoc/com/ibm/as400/access/DecimalDataArea.html#GETDECIMALPOSITIONS()"> number of digits</a> to the right of the decimal point in
|
||
|
the data area</li>
|
||
|
<li>Return the <a href="javadoc/com/ibm/as400/access/DecimalDataArea.html#GETPATH()"> integrated file system path name</a> of the object represented
|
||
|
by the data area.</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/DecimalDataArea.html#READ()">Read</a> all of the data that is contained in the data area</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/DecimalDataArea.html#SETPATH(JAVA.LANG.STRING)"> Set</a> the fully qualified integrated file system path
|
||
|
name of the data area</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/DecimalDataArea.html"> Write</a> data to the beginning of the data area</li>
|
||
|
</ul>
|
||
|
<div class="p" id="dataarea__dataareaex"><a name="dataarea__dataareaex"><!-- --></a><strong>Example: Using DecimalDataArea</strong>The following
|
||
|
example shows how to create and to write to a decimal data area:<div class="note"><span class="notetitle">Note:</span> Read
|
||
|
the <a href="codedisclaimer.htm#codedisclaimer">Code example disclaimer</a> for
|
||
|
important legal information.</div>
|
||
|
</div>
|
||
|
<pre> // Establish a connection to the server "My400".
|
||
|
AS400 system = new AS400("MyServer");
|
||
|
// Create a DecimalDataArea object.
|
||
|
QSYSObjectPathName path = new QSYSObjectPathName("MYLIB", "MYDATA", "DTAARA");
|
||
|
DecimalDataArea dataArea = new DecimalDataArea(system, path.getPath());
|
||
|
// Create the decimal data area on the server using default values.
|
||
|
dataArea.create();
|
||
|
// Clear the data area.
|
||
|
dataArea.clear();
|
||
|
// Write to the data area.
|
||
|
dataArea.write(new BigDecimal("1.2"));
|
||
|
// Read from the data area.
|
||
|
BigDecimal data = dataArea.read();
|
||
|
// Delete the data area from the server.
|
||
|
dataArea.delete();</pre>
|
||
|
</div>
|
||
|
<div class="section" id="dataarea__locdataarea"><a name="dataarea__locdataarea"><!-- --></a><h4 class="sectiontitle">LocalDataArea</h4><p>The <a href="javadoc/com/ibm/as400/access/LocalDataArea.html"> LocalDataArea</a> class
|
||
|
represents a local data area on the server. A local data area exists as a
|
||
|
character data area on the server, but the local data area does have some
|
||
|
restrictions of which you should be aware.</p>
|
||
|
<p>The local data area is associated
|
||
|
with a server job and cannot be accessed from another job. Therefore, you
|
||
|
cannot create or delete the local data area. When the server job ends, the
|
||
|
local data area associated with that server job is automatically deleted,
|
||
|
and the LocalDataArea object that is referring to the job is no longer valid.
|
||
|
You should also note that local data areas are a fixed size of 1024 characters
|
||
|
on the server.</p>
|
||
|
<p>Using the LocalDataArea class, you can do the following:</p>
|
||
|
<ul><li><a href="javadoc/com/ibm/as400/access/LocalDataArea.html#CLEAR()">Clear</a> the data area so that it contains all blanks</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/LocalDataArea.html#READ()">Read</a> all of the data that is contained in the data area</li>
|
||
|
<li>Read a <a href="javadoc/com/ibm/as400/access/LocalDataArea.html#READ(INT, INT)"> specified amount</a> of data from the data area starting
|
||
|
at offset that you specified</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/LocalDataArea.html#WRITE(JAVA.LANG.STRING)"> Write</a> data to the beginning of the data area</li>
|
||
|
<li>Write a <a href="javadoc/com/ibm/as400/access/LocalDataArea.html#WRITE(JAVA.LANG.STRING, INT)"> specified amount</a> of data to the data area where the
|
||
|
first character is written to offset</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section" id="dataarea__logdataarea"><a name="dataarea__logdataarea"><!-- --></a><h4 class="sectiontitle">LogicalDataArea</h4><p>The <a href="javadoc/com/ibm/as400/access/LogicalDataArea.html"> LogicalDataArea</a> class
|
||
|
represents a data area on the server that contains logical data.</p>
|
||
|
<p>Using
|
||
|
the LogicalDataArea class, you can do the following:</p>
|
||
|
<ul><li><a href="javadoc/com/ibm/as400/access/LogicalDataArea.html#CLEAR()"> Clear</a> the data area so that it contains false</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/LogicalDataArea.html#CREATE()"> Create</a> a character data area on the server using default
|
||
|
property values</li>
|
||
|
<li>Create a character data area with <a href="javadoc/com/ibm/as400/access/LogicalDataArea.html#CREATE(BOOLEAN, JAVA.LANG.STRING, JAVA.LANG.STRING)"> specified attributes</a></li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/LogicalDataArea.html#DELETE()"> Delete</a> the data area from the server where the data
|
||
|
area exists</li>
|
||
|
<li>Return the <a href="javadoc/com/ibm/as400/access/LogicalDataArea.html#GETPATH()"> integrated file system path name</a> of the object represented
|
||
|
by the data area.</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/LogicalDataArea.html#READ()">Read</a> all of the data that is contained in the data area</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/LogicalDataArea.html#SETPATH(JAVA.LANG.STRING)"> Set</a> the fully qualified integrated file system path
|
||
|
name of the data area</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/LogicalDataArea.html#WRITE(BOOLEAN)"> Write</a> data to the beginning of the data area</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section" id="dataarea__dataareaevent"><a name="dataarea__dataareaevent"><!-- --></a><h4 class="sectiontitle">DataAreaEvent</h4><p>The <a href="javadoc/com/ibm/as400/access/DataAreaEvent.html"> DataAreaEvent</a> class
|
||
|
represents a data area event.</p>
|
||
|
<p>You can use the DataAreaEvent class with
|
||
|
any of the DataArea classes. Using the DataAreaEvent class, you can do the
|
||
|
following:</p>
|
||
|
<ul><li>Get the <a href="javadoc/com/ibm/as400/access/DataAreaEvent.html#GETID()"> identifier</a> for the event</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section" id="dataarea__dataarealist"><a name="dataarea__dataarealist"><!-- --></a><h4 class="sectiontitle">DataAreaListener</h4><p>The <a href="javadoc/com/ibm/as400/access/DataAreaListener.html#"> DataAreaListener</a> class
|
||
|
provides an interface for receiving data area events.</p>
|
||
|
<p>You can use the
|
||
|
the DataAreaListener class with any of the DataArea classes. You can invoke
|
||
|
the DataAreaListener class when any of the following are performed:</p>
|
||
|
<ul><li><a href="javadoc/com/ibm/as400/access/DataAreaListener.html#CLEARED(COM.IBM.AS400.ACCESS.DATAAREAEVENT)">Clear</a></li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/DataAreaListener.html#CREATED(COM.IBM.AS400.ACCESS.DATAAREAEVENT)">Create</a></li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/DataAreaListener.html#DELETED(COM.IBM.AS400.ACCESS.DATAAREAEVENT)">Delete</a></li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/DataAreaListener.html#READ(COM.IBM.AS400.ACCESS.DATAAREAEVENT)">Read</a></li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/DataAreaListener.html#WRITTEN(COM.IBM.AS400.ACCESS.DATAAREAEVENT)">Write</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|