ibm-information-center/dist/eclipse/plugins/i5OS.ic.rbam6_5.4.0.1/ocfil.htm

74 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="task" />
<meta name="DC.Title" content="Open and close files in a CL procedure" />
<meta name="abstract" content="When you use CL support, the file referred to is implicitly opened when you do your first send, receive, or send/receive operation. An opened display file remains open until the procedure or OPM program in which it was opened returns or transfers control. An opened database file is closed when end of file is reached, or when the procedure or OPM program in which it was opened returns or transfers control. Once a database file has been closed, it cannot be opened again during the same call of the procedure or OPM program." />
<meta name="description" content="When you use CL support, the file referred to is implicitly opened when you do your first send, receive, or send/receive operation. An opened display file remains open until the procedure or OPM program in which it was opened returns or transfers control. An opened database file is closed when end of file is reached, or when the procedure or OPM program in which it was opened returns or transfers control. Once a database file has been closed, it cannot be opened again during the same call of the procedure or OPM program." />
<meta name="DC.subject" content="file, display, opening, closing, declaring, database" />
<meta name="keywords" content="file, display, opening, closing, declaring, database" />
<meta name="DC.Relation" scheme="URI" content="wfile.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="ocfil" />
<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>Open and close files in a CL procedure</title>
</head>
<body id="ocfil"><a name="ocfil"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Open and close files in a CL procedure</h1>
<div><p>When you use CL support, the file referred to is implicitly opened
when you do your first send, receive, or send/receive operation. An opened
display file remains open until the procedure or OPM program in which it was
opened returns or transfers control. An opened database file is closed when
end of file is reached, or when the procedure or OPM program in which it was
opened returns or transfers control. Once a database file has been closed,
it cannot be opened again during the same call of the procedure or OPM program.</p>
<div class="section"> <p>When a database file opens, the first member in the file will
open, unless you previously used an <span class="cmdname">Override Database File (OVRDBF</span>)
command to specify a different member (MBR parameter). If a procedure or OPM
program ends because of an error, the files close. A file remains open until
the procedure or OPM program in which that file was opened ends. Because of
this, you have an easy way to share open data paths between running procedures
and programs. You can open a file in one procedure or program. Then the file
can share its open data path with another procedure or program under either
of the following conditions:</p>
<ul><li>The file was created with or has been changed to have the SHARE(*YES)
attribute.</li>
<li>An override for that file by specifying SHARE(*YES) is in effect.</li>
</ul>
<p>You can share files in this way between any two procedures or programs.
Use online help for a detailed description of the function available when
the system shares open data paths. Additionally, IBM<sup>®</sup> provides a description of the SHARE
parameter on the <span class="cmdname">Create Display File (CRTDSPF)</span>, <span class="cmdname">Create
Physical File (CRTPF)</span>, and <span class="cmdname">Create Logical File (CRTLF)</span> commands
online. A display file opened in a CL procedure or OPM program always opens
for both input and output. A database file opened in a CL procedure or OPM
program opens for input only.</p>
<p>Do not specify LVL(*CALLER) on the <span class="cmdname">Reclaim
Resources (RCLRSC)</span> command in CL procedures and programs using files.
If you specified LVL(*CALLER), all files opened by the procedure or OPM program
would be immediately closed, and any attempt to access the file would end
abnormally.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="wfile.htm" title="Two types of files are supported in CL procedures and programs: display files and database files.">Work with files in CL procedures</a></div>
</div>
</div>
</body>
</html>