ibm-information-center/dist/eclipse/plugins/i5OS.ic.dbp_5.4.0.1/rbafotermpr.htm

94 lines
6.1 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="Close a database file" />
<meta name="abstract" content="When your program completes processing a database file member, it should close the file. Closing a database file disconnects your program from the file." />
<meta name="description" content="When your program completes processing a database file member, it should close the file. Closing a database file disconnects your program from the file." />
<meta name="DC.subject" content="database file, closing, methods, file, database" />
<meta name="keywords" content="database file, closing, methods, file, database" />
<meta name="DC.Relation" scheme="URI" content="rbafoprocess.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafosfile.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/clof.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/rclrsc.htm" />
<meta name="DC.Relation" scheme="URI" content="../rbam6/rbam6clmain.htm" />
<meta name="DC.Relation" scheme="URI" content="../books/sc415606.pdf" />
<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="rbafotermpr" />
<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>Close a database file</title>
</head>
<body id="rbafotermpr"><a name="rbafotermpr"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Close a database file</h1>
<div><p>When your program completes processing a database file member,
it should close the file. Closing a database file disconnects your program
from the file.</p>
<p>The close operation releases all record locks and all file member locks,
forces all changes made through the open data path (ODP) to auxiliary storage,
then destroys the ODP. (When a shared file is closed but the ODP remains open,
the functions differ) </p>
<div class="p">To
close a database file in a program, use one of the following methods: <ul><li class="liexpand">High-level language close statements <p>Most high-level languages allow
you to specify that you want to close your database files. For more information
about how to close a database file in a high-level language program, see your
high-level language topic collection.</p>
</li>
<li class="liexpand">Close File (CLOF) command <p>You can use the CLOF command to close database
files that were opened using either the Open Database File (OPNDBF) or Open
Query File (OPNQRYF) command. </p>
</li>
<li class="liexpand">Reclaim Resources (RCLRSC) command <p>The RCLRSC command releases all
locks (except, under commitment control, locks on records that were changed
but not yet committed), forces all changes to auxiliary storage, then destroys
the ODP for that file. You can use the RCLRSC command to allow a calling program
to close the files of a called program. (For example, if the called program
returns to the calling program without closing its files, the calling program
can then close the files of the called program.) However, the normal way of
closing files in a program is with the high-level language close operation
or through the CLOF command. For more information about resource reclamation
in the integrated language environment, see the ILE Concepts book.</p>
</li>
</ul>
</div>
<p>If a job ends normally (for example, a user signs off) and all the files
associated with that job were not closed, the system automatically closes
all the remaining open files associated with that job, forces all changes
to auxiliary storage, and releases all record locks for those files. If a
job ends abnormally, the system also closes all files associated with that
job, releases all record locks for those files, and forces all changes to
auxiliary storage.</p>
<p>When a process is trying to lock a file that is held by another process,
the Close database file exit program is called. This exit is called in the
process that is holding the lock.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafoprocess.htm" title="These topics discuss how to make your database files process more efficiently on the i5/OS operating system, how to open, manipulate, and close database files, and how to monitor and manage error messages related to your database files.">Process database files</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="rbafosfile.htm" title="By default, the database management system lets one file be read and changed by many users at the same time. However, you can share the database files in the same job or activation group through the SHARE parameter.">Share database files in the same job or activation group</a></div>
<div><a href="../rbam6/rbam6clmain.htm">Control language (CL)</a></div>
<div><a href="../books/sc415606.pdf" target="_blank">ILE Concepts PDF</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="../cl/clof.htm">Close File (CLOF) command</a></div>
<div><a href="../cl/rclrsc.htm">Reclaim Resources (RCLRSC) command</a></div>
</div>
</div>
</body>
</html>