89 lines
5.5 KiB
HTML
89 lines
5.5 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="Manipulating a user space with pointers" />
|
|
<meta name="abstract" content="Some languages, such as ILE C, Visual Age for C++, ILE COBOL, ILE RPG, COBOL, Pascal, and PL/I, support pointers. Pointers allow you to manipulate information more rapidly from the user space." />
|
|
<meta name="description" content="Some languages, such as ILE C, Visual Age for C++, ILE COBOL, ILE RPG, COBOL, Pascal, and PL/I, support pointers. Pointers allow you to manipulate information more rapidly from the user space." />
|
|
<meta name="DC.Relation" scheme="URI" content="listUserSpace.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="listChangeUser.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="listUserPointer" />
|
|
<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>Manipulating a user space with pointers</title>
|
|
</head>
|
|
<body id="listUserPointer"><a name="listUserPointer"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Manipulating a user space with pointers</h1>
|
|
<div><p>Some languages, such as ILE C, Visual Age for C++, ILE COBOL, ILE
|
|
RPG, COBOL, Pascal, and PL/I, support pointers. Pointers allow you to manipulate
|
|
information more rapidly from the user space.</p>
|
|
<div class="section"><h4 class="sectiontitle">Synchronizing between two or more jobs</h4><p>If you are
|
|
using the Change User Space (QUSCHGUS) or Retrieve User Space (QUSRTVUS) API
|
|
to manipulate user spaces, you do not need to synchronize update and retrieve
|
|
operations when multiple jobs access the user space. The APIs already do that
|
|
for you. However, if you are using space pointers to retrieve the information
|
|
directly from the user space, you should synchronize your application programs
|
|
to avoid data errors. This ensures that no two users update the space at the
|
|
same time, which can cause unpredictable results.</p>
|
|
<p>Locks are typically
|
|
used to synchronize two jobs on the system, and you can lock user spaces.
|
|
To synchronize multiple jobs, you can use one of the following:</p>
|
|
<ul><li>Compare and swap (CMPSWP MI instructions)</li>
|
|
<li>Space location locks (LOCKSL and UNLOCKSL MI instructions)</li>
|
|
<li>Object locks (LOCK and UNLOCK MI instructions)</li>
|
|
<li>Allocate Object (ALCOBJ) and Deallocate Object (DLCOBJ) commands</li>
|
|
</ul>
|
|
<p>The preceding list is ordered by relative performance where CMPSWP
|
|
is the fastest. If you do not synchronize two or more jobs, multiple concurrent
|
|
updates to the user space or read operations can occur while information is
|
|
being updated. As a result, the data may not be accurate.</p>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Using offset values with pointers</h4><p>When using a pointer
|
|
to manipulate the user space, you must:</p>
|
|
<ol><li>Get a space pointer to the first byte (offset value of zero) of the user
|
|
space.</li>
|
|
<li>Retrieve the offset value of the information you want to use from the
|
|
user space.</li>
|
|
<li>Add that offset value to the space pointer value.</li>
|
|
<li>Use the space pointer value to directly refer to the information in the
|
|
user space.</li>
|
|
</ol>
|
|
<p>See Example: Changing a user space with an ILE RPG program for an
|
|
example of this procedure.</p>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Updating usage data</h4><p>If you are using
|
|
the Change User Space (QUSCHGUS) or Retrieve User Space (QUSRTVUS) API to
|
|
manipulate user spaces, you do not need to update usage data information.
|
|
If you directly retrieve data using pointers, your application programs should
|
|
update the usage data information. To do this, use the QUSCHGUS API to update
|
|
the date last changed and use the QUSRTVUS API to update the date last retrieved.
|
|
You do not need to do this for each retrieve or change operation to the user
|
|
space, but you should do this once within each application program to maintain
|
|
accurate usage data information.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="listUserSpace.htm" title="The list APIs require a user space for returning information.">User spaces for list APIs</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="listChangeUser.htm" title="These examples illustrate how a user space can be changed.">Examples: Change a user space</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |