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

100 lines
6.4 KiB
HTML
Raw Permalink 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="task" />
<meta name="DC.Title" content="Create a logical file" />
<meta name="abstract" content="This topic shows how to create a logical file using data description specifications (DDS)." />
<meta name="description" content="This topic shows how to create a logical file using data description specifications (DDS)." />
<meta name="DC.subject" content="logical file, creating, with DDS, methods, file, logical" />
<meta name="keywords" content="logical file, creating, with DDS, methods, file, logical" />
<meta name="DC.Relation" scheme="URI" content="rbafologif.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafocrlff.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafologfm.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/crtlf.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafosrcwrk.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafoformt.htm" />
<meta name="DC.Relation" scheme="URI" content="../rzatc/rzatcview.htm" />
<meta name="DC.Relation" scheme="URI" content="../db2/rbafzmsthcview.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="rbafocrlof" />
<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>Create a logical file</title>
</head>
<body id="rbafocrlof"><a name="rbafocrlof"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Create a logical file</h1>
<div><p>This topic shows how to create a logical file using data description
specifications (DDS). </p>
<div class="p">The physical file or files on which the logical file is based must
already exist before you create a logical file.</div>
<div class="section"><p>To create a logical file, follow these steps:</p>
</div>
<ol><li class="stepexpand"><span>Type the DDS for the logical file into a source file. </span> This
can be done using the source entry utility (SEU) or another method. The following
example shows the DDS for logical file ORDHDRL (an order header file): <pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A* ORDER HEADER LOGICAL FILE (ORDHDRL)
A R ORDHDR PFILE(ORDHDRP)
A K ORDER
</pre>
<p>This file uses the key field <em>Order</em> (order number) to
define the access path. The record format is the same as the associated physical
file ORDHDRP. The record format name for the logical file must be the same
as the record format name for the physical file because no field descriptions
are given.</p>
</li>
<li class="stepexpand"><span>Create the logical file.</span> You can use the Create Logical
File (CRTLF) command. The following example shows how the CRTLF command can
be typed: <pre>CRTLF FILE(DSTPRODLB/ORDHDRL)
TEXT('Order header logical file')</pre>
</li>
</ol>
<div class="section"> <p>As shown, this command uses some defaults. For example, because
the SRCFILE and SRCMBR parameters are not specified, the system uses DDS from
the IBM-supplied source file QDDSSRC, and the source file member name is ORDHDRL
(the same as the file name specified on the CRTLF command). The file ORDHDRL
with one member of the same name is placed in the library DSTPRODLB.</p>
<p>You
can create multiple logical files over a single physical file. The maximum
number of logical files that can be created over a single physical file is
32K. </p>
<p>Similar to logical files are views. Views can be created using iSeries™ Navigator
or using the CREATE VIEW SQL statement.</p>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rbafocrlff.htm">Create a logical file with more than one record format</a></strong><br />
A multiple format logical file lets you use related records from two or more physical files by referring to only one logical file. Each record format is always associated with one or more physical files. You can use the same physical file in more than one record format.</li>
<li class="ulchildlink"><strong><a href="rbafologfm.htm">Define logical file members</a></strong><br />
You can define members in logical files to separate the data into logical groups. The logical file member can be associated with one or several physical file members.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafologif.htm" title="These topics discuss some of the unique considerations for creating logical files.">Set up logical files</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="rbafosrcwrk.htm" title="These topics describe how to enter and maintain data using various methods.">Work with source files</a></div>
<div><a href="rbafoformt.htm" title="If your application uses a file name instead of a record format name for records to be added to the database, and if the file used is a logical file with more than one record format, you need to write a format selector program to determine where a record should be placed in the database.">Identify which record format to add in a file with multiple formats</a></div>
<div><a href="../rzatc/rzatcview.htm">Create and use a view</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="../cl/crtlf.htm">Create Logical File (CRTLF) command</a></div>
<div><a href="../db2/rbafzmsthcview.htm">CREATE VIEW</a></div>
</div>
</div>
</body>
</html>