97 lines
7.1 KiB
HTML
97 lines
7.1 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="Direct file support with ILE COBOL" />
|
||
|
<meta name="abstract" content="An iSeries server does not support direct files as one of its file types. However, an ILE COBOL program on iSeries server can specify that a file be accessed as a direct file." />
|
||
|
<meta name="description" content="An iSeries server does not support direct files as one of its file types. However, an ILE COBOL program on iSeries server can specify that a file be accessed as a direct file." />
|
||
|
<meta name="DC.subject" content="Create Direct File (CRTDIRF) command, command, DDM, CRTDIRF (Create Direct File), direct file (DIRFIL), ILE COBOL support, ILE COBOL programming language, direct file, OPEN statement, OUTPUT parameter, OUTPUT (Output) parameter, SELECT statement" />
|
||
|
<meta name="keywords" content="Create Direct File (CRTDIRF) command, command, DDM, CRTDIRF (Create Direct File), direct file (DIRFIL), ILE COBOL support, ILE COBOL programming language, direct file, OPEN statement, OUTPUT parameter, OUTPUT (Output) parameter, SELECT statement" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbae5cobolcon.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1999, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1999, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="rbae5cobdir" />
|
||
|
<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>Direct file support with ILE COBOL</title>
|
||
|
</head>
|
||
|
<body id="rbae5cobdir"><a name="rbae5cobdir"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Direct file support with ILE COBOL</h1>
|
||
|
<div><p>An <span class="keyword">iSeries™ server</span> does
|
||
|
not support direct files as one of its file types. However, an ILE COBOL program
|
||
|
on <span class="keyword">iSeries server</span> can specify that
|
||
|
a file be accessed as a <em>direct</em> file.</p>
|
||
|
<div class="section"><p>An <span class="keyword">iSeries server</span> normally
|
||
|
creates direct files as <em>sequential</em> files. An ILE COBOL program on an <span class="keyword">iSeries server</span> defines a file as a direct
|
||
|
file by specifying RELATIVE on the SELECT statement. If the program is to
|
||
|
open the file for output only (by specifying OUTPUT on the OPEN statement),
|
||
|
the file must be created with deleted records and contain no active records.
|
||
|
This is also the file's condition when a non-<span class="keyword">iSeries</span> source
|
||
|
server (such as <span class="keyword">System/36™</span>) uses
|
||
|
DDM to create or clear the direct file on an <span class="keyword">iSeries server</span>,
|
||
|
assuming that the file is created as described in the following paragraphs.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>An <span class="keyword">iSeries server</span> and <span class="keyword">System/38™</span> support sequential and keyed
|
||
|
file types. DDM recognizes sequential, keyed, and direct file types. For a
|
||
|
non-<span class="keyword">iSeries server</span> to create a direct
|
||
|
file on an <span class="keyword">iSeries server</span> using DDM,
|
||
|
the DDM architecture command <span class="cmdname">Create Direct File (CRTDIRF)</span> is
|
||
|
used.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>When the <span class="cmdname">CRTDIRF</span> architecture command is issued
|
||
|
from a non-<span class="keyword">iSeries server</span> to create
|
||
|
the file, the file is created as a physical file and is designated as a direct
|
||
|
file so that, for subsequent direct file access by non-<span class="keyword">iSeries</span> source
|
||
|
servers, it will be identifiable to the other server as a direct file. If
|
||
|
the file is not created in this way, an <span class="keyword">iSeries server</span> cannot
|
||
|
later determine whether the file is a direct file or a sequential file, again,
|
||
|
because an <span class="keyword">iSeries server</span> does not
|
||
|
have direct files as one of its file types.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>Therefore, if an ILE COBOL program on a server other than an <span class="keyword">iSeries server</span> or a <span class="keyword">System/38</span> needs
|
||
|
to access an <span class="keyword">iSeries</span> or a <span class="keyword">System/38</span> file in a direct mode (that
|
||
|
is, by relative record number) for output, the file must have been created
|
||
|
by the <span class="cmdname">CRTDIRF</span> architecture command.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>To support direct files on an <span class="keyword">iSeries server</span> for
|
||
|
output only, the ILE COBOL OPEN statement clears and prepares a member of
|
||
|
a file being opened. Therefore, existing <span class="keyword">iSeries</span> or <span class="keyword">System/38</span> files can be accessed by using
|
||
|
DDM files by ILE COBOL programs on other <span class="keyword">iSeries server</span>s
|
||
|
or <span class="keyword">System/38</span>s. For non-<span class="keyword">iSeries</span> target servers, relative files
|
||
|
opened for output must be defined as direct files or an error occurs.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>In summary:</p>
|
||
|
<ul><li>If a file is created on the local <span class="keyword">iSeries server</span> as
|
||
|
a direct file by a program or user from a <em>non</em>-<span class="keyword">iSeries server</span>,
|
||
|
the file can be accessed as a direct file by an ILE COBOL program
|
||
|
from a remote non-<span class="keyword">iSeries</span> source
|
||
|
server.</li>
|
||
|
<li>If a file is created on the local <span class="keyword">iSeries server</span> by
|
||
|
a program or user on the <em>same</em> <span class="keyword">iSeries server</span>,
|
||
|
it cannot be accessed as a direct file by a non-<span class="keyword">iSeries server</span> because
|
||
|
the <span class="keyword">iSeries</span> target server cannot
|
||
|
determine, in this case, whether the file is a direct or sequential file.</li>
|
||
|
<li>Any files created by a remote server can be used locally.</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbae5cobolcon.htm" title="ILE COBOL programs can refer to DDM files. Generally, DDM file names can be specified in ILE COBOL programming language anywhere a database file name can be specified, for both iSeries and non-iSeries target servers.">ILE COBOL considerations for DDM</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|