271 lines
17 KiB
HTML
271 lines
17 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="Length for physical and logical files (positions 30 through 34)" />
|
||
<meta name="abstract" content="Use these positions to specify the length of a physical or logical file field." />
|
||
<meta name="description" content="Use these positions to specify the length of a physical or logical file field." />
|
||
<meta name="DC.subject" content="length, logical files, physical files" />
|
||
<meta name="keywords" content="length, logical files, physical files" />
|
||
<meta name="DC.Relation" scheme="URI" content="rzakbmstlfpos.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="specrecs.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="rzakbmsttdsst.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="simpmult.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="rzakbmsttdjfld.htm" />
|
||
<meta name="copyright" content="(C) Copyright IBM Corporation 2001, 2006" />
|
||
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2001, 2006" />
|
||
<meta name="DC.Format" content="XHTML" />
|
||
<meta name="DC.Identifier" content="lleng" />
|
||
<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>Length for physical and logical files (positions 30 through 34)</title>
|
||
</head>
|
||
<body id="lleng"><a name="lleng"><!-- --></a>
|
||
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
<h1 class="topictitle1">Length for physical and logical files (positions 30 through 34)</h1>
|
||
<div><p>Use these positions to specify the length of a physical or logical
|
||
file field.</p>
|
||
<div class="section"><p>For a physical file, use these positions to specify the field
|
||
length for each named field (unless you copy it from a referenced field).
|
||
Specify the number of digits for a numeric type field, or specify the number
|
||
of characters for a character type field.</p>
|
||
<p>For a logical file, use these
|
||
positions to specify the length of a logical field. Specify the length only
|
||
to override or change the length of the corresponding field in the physical
|
||
file on which this logical file is based. If you leave this position blank,
|
||
the field you are defining has the same length as the corresponding field
|
||
in the physical file(s) on which the logical file(s) is based. If the field
|
||
in the physical file is variable length and you leave the length blank, the
|
||
field is also variable length in the logical file. If you do specify a length,
|
||
the field in the logical file is fixed length unless you also specify the
|
||
VARLEN keyword. Additionally, the SST (Substring) keyword can be used to control
|
||
the length of a logical file field by specifying a character string that is
|
||
a subset of another field.</p>
|
||
<p>If you specify length, it must be right-aligned;
|
||
leading zeros are optional.</p>
|
||
</div>
|
||
<div class="example"><p><a href="#lleng__bfig3">Figure 1</a> shows correct and incorrect
|
||
field length specifications for a physical file.</p>
|
||
<div class="fignone" id="lleng__bfig3"><a name="lleng__bfig3"><!-- --></a><span class="figcap">Figure 1. Correct
|
||
and incorrect length specifications for physical files</span><pre>|...+....1....+....2....+....3....+....4....+....5
|
||
00010A FIELD1 7
|
||
A
|
||
00020A FIELD2 7
|
||
A
|
||
00030A FIELD3 R +7
|
||
A
|
||
</pre>
|
||
<div class="note"><span class="notetitle">Note:</span> FIELD1 shows the field length specified incorrectly. FIELD2 and FIELD3
|
||
show the field length specified correctly.</div>
|
||
</div>
|
||
<p>Valid length specifications are:</p>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="void" border="0" rules="none"><thead align="left"><tr><th align="left" valign="bottom" width="50%" id="d0e59"> Data type</th>
|
||
<th align="left" valign="bottom" width="50%" id="d0e61"> Valid lengths</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr><td align="left" valign="top" width="50%" headers="d0e59 "> Character</td>
|
||
<td align="left" valign="top" width="50%" headers="d0e61 "> 1 through 32 766 characters</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="50%" headers="d0e59 "> Hexadecimal</td>
|
||
<td align="left" valign="top" width="50%" headers="d0e61 "> 1 through 32 766 bytes</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="50%" headers="d0e59 "> Binary</td>
|
||
<td align="left" valign="top" width="50%" headers="d0e61 "> 1 through 18 digits</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="50%" headers="d0e59 "> Binary character</td>
|
||
<td align="left" valign="top" width="50%" headers="d0e61 "> 1 through 32 766 characters</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="50%" headers="d0e59 "> Zoned decimal</td>
|
||
<td align="left" valign="top" width="50%" headers="d0e61 "> 1 through 63 digits</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="50%" headers="d0e59 "> Packed decimal</td>
|
||
<td align="left" valign="top" width="50%" headers="d0e61 "> 1 through 63 digits</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="50%" headers="d0e59 "> Floating-point (single precision)</td>
|
||
<td align="left" valign="top" width="50%" headers="d0e61 "> 1 through 9 digits</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="50%" headers="d0e59 "> Floating-point (double precision)</td>
|
||
<td align="left" valign="top" width="50%" headers="d0e61 "> 1 through 17 digits</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="50%" headers="d0e59 "> Date</td>
|
||
<td align="left" valign="top" width="50%" headers="d0e61 "> 6, 8, or 10 characters</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="50%" headers="d0e59 "> Time</td>
|
||
<td align="left" valign="top" width="50%" headers="d0e61 "> 8 characters</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="50%" headers="d0e59 "> Timestamp</td>
|
||
<td align="left" valign="top" width="50%" headers="d0e61 "> 26 characters</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<div class="section"><p>The length for fields with data type L (date), T (time), or Z
|
||
(timestamp) is determined by the system. You should not enter a field length
|
||
in positions 30 through 34.</p>
|
||
<p>The field length for date and time includes
|
||
the separator.</p>
|
||
<div class="p">A timestamp has a fixed format that has the following
|
||
form: <pre>YYYY-MM-DD-hh.mm.ss.uuuuuu</pre>
|
||
</div>
|
||
<p>Type in a maximum
|
||
of 9 digits for single precision and 17 digits for double precision. The <span class="keyword">i5/OS™</span> program supports a floating-point
|
||
accuracy of 7 digits for single precision and 15 digits for double precision.</p>
|
||
<p>The
|
||
total number of bytes occupied by all the fields in a record must not exceed
|
||
32 766 (in storage). See <a href="#lleng__zlength">Table 1</a> for rules
|
||
on determining the total length of the record format.</p>
|
||
<p>The
|
||
system determines the number of bytes actually occupied in storage as follows:</p>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="void" border="0" rules="none"><thead align="left"><tr><th align="left" valign="bottom" width="36.54916512059369%" id="d0e147"> Data type</th>
|
||
<th align="left" valign="bottom" width="63.4508348794063%" id="d0e149"> Bytes occupied in storage</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> Character</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> Number of characters</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> Hexadecimal</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> Number of bytes</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> Binary</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> </td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> 1 through 4 digits</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> 2 bytes</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> 5 through 9 digits</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> 4 bytes</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> 10 through 18 digits</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> 8 bytes</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> Binary character</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> Number of characters</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> Zoned decimal</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> Number of digits</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> Packed decimal</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> (Number of digits/2) + 1 (truncated
|
||
if fractional)</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> Floating-point (single precision)</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> 4 bytes</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> Floating-point (double precision)</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> 8 bytes</td>
|
||
</tr>
|
||
<tr><td rowspan="2" align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> Date</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> 10 characters without DATFMT keyword </td>
|
||
</tr>
|
||
<tr><td valign="top" width="63.4508348794063%" headers="d0e149 ">6, 8 or 10 characters with DATFMT keyword</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> Time</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> 8 characters</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="36.54916512059369%" headers="d0e147 "> Timestamp</td>
|
||
<td align="left" valign="top" width="63.4508348794063%" headers="d0e149 "> 26 characters</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="note"><span class="notetitle">Note:</span> The system performs arithmetic operations more efficiently for
|
||
a packed decimal than for a zoned decimal data type.</div>
|
||
</div>
|
||
<div class="section"><p><a href="#lleng__zlength">Table 1</a> describes
|
||
the rules for determining total format length.</p>
|
||
|
||
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
|
||
<a name="lleng__zlength"><!-- --></a><table cellpadding="4" cellspacing="0" summary="" id="lleng__zlength" width="100%" border="0"><caption>Table 1. Rules for determining
|
||
total format length</caption><thead align="left"><tr><th align="left" valign="bottom" width="41.00185528756957%" id="d0e240">Situation</th>
|
||
<th align="left" valign="bottom" width="58.998144712430424%" id="d0e242">Action</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr><td align="left" valign="top" width="41.00185528756957%" headers="d0e240 ">Does the record format contain any variable-length
|
||
fields?</td>
|
||
<td align="left" valign="top" width="58.998144712430424%" headers="d0e242 "><ol><li>Add an extra 24 bytes to the total format length.</li>
|
||
<li>Add an extra 2 bytes to the format length for each field that is variable
|
||
length.</li>
|
||
</ol>
|
||
</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="41.00185528756957%" headers="d0e240 ">Does the record format contain any fields
|
||
that allow the null value?</td>
|
||
<td align="left" valign="top" width="58.998144712430424%" headers="d0e242 ">Divide the total number of fields in the
|
||
format by 8, round up to the next highest whole byte, then add to format length.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</td></tr></table>
|
||
<p>To override the length of a referenced field (R in position 29)
|
||
of a physical file or the length of the field in a logical file, either specify
|
||
a new value or a change in length. To increase the length, specify <tt>+n</tt>,
|
||
where n is the amount of increase. To decrease the length, specify <tt>-n</tt>,
|
||
where n is the amount of decrease. For example, type <tt>+4</tt> to indicate
|
||
that a numeric field is to be 4 digits longer than the referenced field. See
|
||
the <a href="rzakbmstlfpos.htm">Positional entries for physical and logical files (positions 1 through 44)</a> topic for an example showing how
|
||
to override the field length for a physical file.</p>
|
||
<p>If the
|
||
corresponding field in the physical file record format has a data type of
|
||
binary with decimal positions greater than zero, the length cannot be overridden
|
||
in the logical file. If the field you are describing is a concatenation of
|
||
fields from the associated physical record format, you cannot specify the
|
||
length in the logical file. The sum of the physical field lengths is calculated
|
||
by the system.</p>
|
||
<div class="p">If you specify a value in positions 30 through 34, your
|
||
program sees the specified length. However, the length of the field in the
|
||
corresponding physical file field does not change. This can cause data conversion
|
||
errors. When attempting to add a member to a file or to open a member of a
|
||
file, the operating system might send a mapping error message. The operating
|
||
system might also send a mapping error message to your program in the following
|
||
cases: <ul><li>When reading from a logical file that reduces the length specified in
|
||
the corresponding physical file</li>
|
||
<li>When writing to a logical file that increases the length specified in
|
||
the corresponding physical file</li>
|
||
</ul>
|
||
</div>
|
||
<p>For example, if the physical file field is defined as 4 characters
|
||
long and the logical file field decreases the length to 2 characters, a value
|
||
of ABCD in the physical file cannot be read by the program, although a value
|
||
of AB can. In this case, the program can always write successfully. For character
|
||
fields, the data is left-aligned and filled with blanks in the physical file
|
||
field. For numeric fields, the data is right-aligned and filled with zeros
|
||
in the physical file field.</p>
|
||
<p>Positions 30 through 34 are valid only for
|
||
field specifications. You must leave these positions blank at the key field,
|
||
select/omit field, join, record, and file level.</p>
|
||
<div class="note"><span class="notetitle">Note:</span> High-level languages
|
||
can impose restrictions on the field length. Any length restrictions should
|
||
be observed for files used by these high-level languages.</div>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzakbmstlfpos.htm" title="The first 44 positions of the DDS form are called positional entries.">Positional entries for physical and logical files (positions 1 through 44)</a></div>
|
||
</div>
|
||
<div class="relconcepts"><strong>Related concepts</strong><br />
|
||
<div><a href="specrecs.htm" title="If there is more than one record format specified in a logical file, you must specify the PFILE keyword for each record format.">Specify record formats in a logical file in DDS</a></div>
|
||
</div>
|
||
<div class="reltasks"><strong>Related tasks</strong><br />
|
||
<div><a href="simpmult.htm" title="You must specify the PFILE keyword at the record level for simple and multiple format logical files. In a multiple format logical file, a record format can use only the fields common to all the physical files specified on the PFILE keyword for that record format.">Simple and multiple format logical files in DDS</a></div>
|
||
</div>
|
||
<div class="relref"><strong>Related reference</strong><br />
|
||
<div><a href="rzakbmsttdsst.htm" title="Use this field-level keyword to specify a character string that is a subset of an existing character, hexadecimal, zoned field, or graphic.">SST (Substring) keyword—logical files only</a></div>
|
||
<div><a href="rzakbmsttdjfld.htm" title="Use this join-level keyword to identify the from and to fields whose values are used to join physical files in a join logical file. These fields are both referred to as join fields.">JFLD (Joined Fields) keyword—join logical files only</a></div>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html> |