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

237 lines
17 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="concept" />
<meta name="DC.Title" content="Describe logical file record formats" />
<meta name="abstract" content="For every logical file record format described with data description specifications (DDS), you must specify a record format name and either the PFILE keyword (for simple and multiple format logical files), or the JFILE keyword (for join logical files)." />
<meta name="description" content="For every logical file record format described with data description specifications (DDS), you must specify a record format name and either the PFILE keyword (for simple and multiple format logical files), or the JFILE keyword (for join logical files)." />
<meta name="DC.subject" content="describing, logical file, record format, format, record, logical file, describing, designing, additional named fields, file, logical, describing record format, PFILE (Physical File) keyword, keyword, DDS, PFILE (Physical File), JFILE (Joined Files) keyword, Joined Files (JFILE) keyword, JFILE (Joined Files)" />
<meta name="keywords" content="describing, logical file, record format, format, record, logical file, describing, designing, additional named fields, file, logical, describing record format, PFILE (Physical File) keyword, keyword, DDS, PFILE (Physical File), JFILE (Joined Files) keyword, Joined Files (JFILE) keyword, JFILE (Joined Files)" />
<meta name="DC.Relation" scheme="URI" content="rbafologif.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafodeffd.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafodescdrv.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafofpdbc.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafoappdbcs.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="rbafodrflf" />
<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>Describe logical file record formats</title>
</head>
<body id="rbafodrflf"><a name="rbafodrflf"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Describe logical file record formats</h1>
<div><p>For every logical file record format described with data description
specifications (DDS), you must specify a record format name and either the
PFILE keyword (for simple and multiple format logical files), or the JFILE
keyword (for join logical files).</p>
<div class="p">The file names specified on the PFILE or JFILE keyword are the physical
files that the logical file is based on. A simple or multiple-format logical
file record format can be specified with DDS in any one of the following ways: <ul><li class="liexpand">In the simple logical file record format, specify only the record format
name and the PFILE keyword. The record format for the only (or first) physical
file specified on the PFILE keyword is the record format for the logical file.
The record format name specified in the logical file must be the same as the
record format name in the only (or first) physical file. Consider this example
of a simple logical file: <pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A
A R ORDDTL PFILE(ORDDTLP)
A</pre>
</li>
<li class="liexpand">Describe
your own record format by listing the field names you want to include. You
can specify the field names in a different order, rename fields using the
RENAME keyword, combine fields using the CONCAT keyword, and use specific
positions of a field using the SST keyword. You can also override attributes
of the fields by specifying different attributes in the logical file. Consider
this example of a simple logical file with fields specified:: <pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A
A R ORDHDR PFILE(ORDHDRP)
A ORDER
A CUST
A SHPVIA
A</pre>
</li>
<li class="liexpand">Specify the name of a database file for the file name on the FORMAT keyword.
The record format is shared from this database file by the logical file being
described. The file name can be qualified by a library name. If a library
name is not specified, the library list is used to find the file. The file
must exist when the file you are describing is created. In addition, the record
format name you specify in the logical file must be the same as one of the
record format names in the file you specify on the FORMAT keyword. Consider
this example: <pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A
A R CUSRCD PFILE(CUSMSTP)
A FORMAT(CUSMSTL)
A</pre>
</li>
</ul>
</div>
<div class="p">In the following example, a program needs: <ul><li>The fields placed in a different order</li>
<li>A subset of the fields from the physical file</li>
<li>The data types changed for some fields</li>
<li>The field lengths changed for some fields</li>
</ul>
</div>
<p>You can use a logical file to make these changes.</p>
<br /><img src="rbafo503.gif" alt="Examples of files" /><br /><p>For the logical file, the DDS would be as follows:</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A
A R LOGREC PFILE(PF1)
A D 10S 0
A A
A C 5S 0
A</pre>
<p>For the physical file, the DDS would be as follows:</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A
A R PHYREC
A A 8S 2
A B 32
A C 2B 0
A D 10
A</pre>
<p>When a record is read from the logical file, the fields from the physical
file are changed to match the logical file description. If the program updates
or adds a record, the fields are changed back. For an add or update operation
using a logical file, the program must supply data that conforms with the
format used by the logical file.</p>
<p>The following chart shows what types of data mapping are valid between
physical and logical files.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><thead align="left"><tr><th rowspan="2" align="left" valign="top" width="16.38225255972696%" id="d0e133">Physical file data type</th>
<th colspan="8" align="center" valign="bottom" id="d0e135">Logical
file data type</th>
</tr>
<tr><th align="left" valign="bottom" width="13.48122866894198%" id="d0e138">Character or hexadecimal</th>
<th align="left" valign="bottom" width="10.750853242320819%" id="d0e140">Zoned</th>
<th align="left" valign="bottom" width="10.580204778156997%" id="d0e142">Packed</th>
<th align="left" valign="bottom" width="10.580204778156997%" id="d0e144">Binary</th>
<th align="left" valign="bottom" width="10.580204778156997%" id="d0e146">Floating point</th>
<th align="left" valign="bottom" width="7.679180887372014%" id="d0e148">Date</th>
<th align="left" valign="bottom" width="7.849829351535837%" id="d0e150">Time</th>
<th align="left" valign="bottom" width="12.1160409556314%" id="d0e152">Timestamp</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="16.38225255972696%" headers="d0e133 ">Character or Hexadecimal</td>
<td align="left" valign="top" width="13.48122866894198%" headers="d0e135 d0e138 ">Valid</td>
<td align="left" valign="top" width="10.750853242320819%" headers="d0e135 d0e140 ">See Notes 1</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e142 ">Not valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e144 ">Not valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e146 ">Not valid</td>
<td align="left" valign="top" width="7.679180887372014%" headers="d0e135 d0e148 ">Not valid</td>
<td align="left" valign="top" width="7.849829351535837%" headers="d0e135 d0e150 ">Not valid</td>
<td align="left" valign="top" width="12.1160409556314%" headers="d0e135 d0e152 ">Not valid</td>
</tr>
<tr><td align="left" valign="top" width="16.38225255972696%" headers="d0e133 ">Zoned</td>
<td align="left" valign="top" width="13.48122866894198%" headers="d0e135 d0e138 ">See Notes 1</td>
<td align="left" valign="top" width="10.750853242320819%" headers="d0e135 d0e140 ">Valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e142 ">Valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e144 ">See Notes 2</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e146 ">Valid</td>
<td align="left" valign="top" width="7.679180887372014%" headers="d0e135 d0e148 ">Not valid</td>
<td align="left" valign="top" width="7.849829351535837%" headers="d0e135 d0e150 ">Not valid</td>
<td align="left" valign="top" width="12.1160409556314%" headers="d0e135 d0e152 ">Not Valid</td>
</tr>
<tr><td align="left" valign="top" width="16.38225255972696%" headers="d0e133 ">Packed</td>
<td align="left" valign="top" width="13.48122866894198%" headers="d0e135 d0e138 ">Not valid</td>
<td align="left" valign="top" width="10.750853242320819%" headers="d0e135 d0e140 ">Valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e142 ">Valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e144 ">See Notes 2</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e146 ">Valid</td>
<td align="left" valign="top" width="7.679180887372014%" headers="d0e135 d0e148 ">Not valid</td>
<td align="left" valign="top" width="7.849829351535837%" headers="d0e135 d0e150 ">Not valid</td>
<td align="left" valign="top" width="12.1160409556314%" headers="d0e135 d0e152 ">Not valid</td>
</tr>
<tr><td align="left" valign="top" width="16.38225255972696%" headers="d0e133 ">Binary</td>
<td align="left" valign="top" width="13.48122866894198%" headers="d0e135 d0e138 ">Not valid</td>
<td align="left" valign="top" width="10.750853242320819%" headers="d0e135 d0e140 ">See Notes 2</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e142 ">See Notes 2</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e144 ">See Notes 3</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e146 ">See Notes 2</td>
<td align="left" valign="top" width="7.679180887372014%" headers="d0e135 d0e148 ">Not valid</td>
<td align="left" valign="top" width="7.849829351535837%" headers="d0e135 d0e150 ">Not valid</td>
<td align="left" valign="top" width="12.1160409556314%" headers="d0e135 d0e152 ">Not valid</td>
</tr>
<tr><td align="left" valign="top" width="16.38225255972696%" headers="d0e133 ">Floating point</td>
<td align="left" valign="top" width="13.48122866894198%" headers="d0e135 d0e138 ">Not valid</td>
<td align="left" valign="top" width="10.750853242320819%" headers="d0e135 d0e140 ">Valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e142 ">Valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e144 ">See Notes 2</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e146 ">Valid</td>
<td align="left" valign="top" width="7.679180887372014%" headers="d0e135 d0e148 ">Not valid</td>
<td align="left" valign="top" width="7.849829351535837%" headers="d0e135 d0e150 ">Not valid</td>
<td align="left" valign="top" width="12.1160409556314%" headers="d0e135 d0e152 ">Not valid</td>
</tr>
<tr><td align="left" valign="top" width="16.38225255972696%" headers="d0e133 ">Date</td>
<td align="left" valign="top" width="13.48122866894198%" headers="d0e135 d0e138 ">Not valid</td>
<td align="left" valign="top" width="10.750853242320819%" headers="d0e135 d0e140 ">Valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e142 ">Not valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e144 ">Not valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e146 ">Not valid</td>
<td align="left" valign="top" width="7.679180887372014%" headers="d0e135 d0e148 ">Valid</td>
<td align="left" valign="top" width="7.849829351535837%" headers="d0e135 d0e150 ">Not valid</td>
<td align="left" valign="top" width="12.1160409556314%" headers="d0e135 d0e152 ">Not valid</td>
</tr>
<tr><td align="left" valign="top" width="16.38225255972696%" headers="d0e133 ">Time</td>
<td align="left" valign="top" width="13.48122866894198%" headers="d0e135 d0e138 ">Not valid</td>
<td align="left" valign="top" width="10.750853242320819%" headers="d0e135 d0e140 ">Valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e142 ">Not valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e144 ">Not valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e146 ">Not valid</td>
<td align="left" valign="top" width="7.679180887372014%" headers="d0e135 d0e148 ">Not valid</td>
<td align="left" valign="top" width="7.849829351535837%" headers="d0e135 d0e150 ">Valid</td>
<td align="left" valign="top" width="12.1160409556314%" headers="d0e135 d0e152 ">Not valid</td>
</tr>
<tr><td align="left" valign="top" width="16.38225255972696%" headers="d0e133 ">Time Stamp</td>
<td align="left" valign="top" width="13.48122866894198%" headers="d0e135 d0e138 ">Not valid</td>
<td align="left" valign="top" width="10.750853242320819%" headers="d0e135 d0e140 ">Not valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e142 ">Not valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e144 ">Not valid</td>
<td align="left" valign="top" width="10.580204778156997%" headers="d0e135 d0e146 ">Not valid</td>
<td align="left" valign="top" width="7.679180887372014%" headers="d0e135 d0e148 ">Valid</td>
<td align="left" valign="top" width="7.849829351535837%" headers="d0e135 d0e150 ">Valid</td>
<td align="left" valign="top" width="12.1160409556314%" headers="d0e135 d0e152 ">Valid</td>
</tr>
<tr><td colspan="9" align="left" valign="top" headers="d0e133 d0e135 d0e138 d0e140 d0e142 d0e144 d0e146 d0e148 d0e150 d0e152 "><div class="note"><span class="notetitle">Notes:</span> <ol><li>Valid only if the number of characters or bytes equals the number of digits.</li>
<li>Valid only if the binary field has zero decimal positions.</li>
<li>Valid only if both binary fields have the same number of decimal positions.</li>
</ol>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rbafodeffd.htm">Describe field use for logical files</a></strong><br />
You can specify that the fields in logical files are to be input-only, both (input/output), or neither fields.</li>
<li class="ulchildlink"><strong><a href="rbafodescdrv.htm">Derive new fields from existing fields</a></strong><br />
Fields in a logical file can be derived from fields in the physical file on which the logical file is based or from fields in the same logical file.</li>
<li class="ulchildlink"><strong><a href="rbafofpdbc.htm">Describe floating-point fields in logical files</a></strong><br />
You can use floating-point fields as mapped fields in logical files. A single- or double-precision floating-point field can be mapped to or from a zoned, packed, zero-precision binary, or another floating-point field. You cannot map between a floating-point field and a nonzero-precision binary field, a character field, a hexadecimal field, or a double-byte character set (DBCS) field.</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="rbafoappdbcs.htm" title="These topics describe double-byte character set (DBCS) considerations as they apply to the database on the iSeries system.">Double-byte character set considerations</a></div>
</div>
</div>
</body>
</html>