ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzakb_5.4.0.1/rzakbmsttdvarle.htm

91 lines
5.2 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="reference" />
<meta name="DC.Title" content="VARLEN (Variable-Length Field) keyword for physical and logical files" />
<meta name="abstract" content="Use this field-level keyword to define this field as a variable-length field." />
<meta name="description" content="Use this field-level keyword to define this field as a variable-length field." />
<meta name="DC.subject" content="VARLEN (Variable-Length Field) keyword, Variable-Length Field (VARLEN) keyword" />
<meta name="keywords" content="VARLEN (Variable-Length Field) keyword, Variable-Length Field (VARLEN) keyword" />
<meta name="DC.Relation" scheme="URI" content="rzakbmstlfkeyw.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="tdvarle" />
<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>Physical and Logical Files, VARLEN</title>
</head>
<body id="tdvarle"><a name="tdvarle"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">VARLEN (Variable-Length Field) keyword for physical and logical files</h1>
<div><p>Use this field-level keyword to define this field as a variable-length
field.</p>
<div class="section"><p>Variable-length fields are useful for improving storage when the
data for the field typically fits within a certain length, but can occasionally
be longer. Specify the maximum length of the field in positions 30 to 34.
You can specify the allocated length (or typical length) in the parameter.</p>
<div class="p">The
format of the keyword is: <pre>VARLEN[(allocated-length)]</pre>
</div>
<p>The
allocated-length parameter is optional. Use it to specify the number of bytes
(two byte characters in the case of graphic fields) allocated for the field
in the fixed portion of the file. If you do not specify the allocated-length
parameter, the data for this field is stored in the variable length portion
of the file.</p>
<p>Valid values for the allocated-length parameter are 1 to
the maximum length of the field specified in positions 30 to 34.</p>
<p>The
VARLEN keyword has no parameters for a logical file.</p>
<p>The VARLEN keyword
is valid only on character fields and graphic fields.</p>
<p>When you specify
the VARLEN keyword, the maximum length you can specify in positions 30 to
34 is 32 740 (32 739 if the field allows the null value). If the
field is a graphic field, the maximum length you can specify is 16 370.</p>
<p>If
you specify the DFT keyword for a variable-length field, the length of the
default value must be less than or equal to the allocated length for the field.
If the default value is longer than the allocated length, an error message
is issued when the file is created.</p>
<p>If you specify a hexadecimal value
as the default value for a variable-length field, the number of hexadecimal
characters must be equal to two times the allocated length for the field.</p>
<p>The
DFT keyword is not allowed on the same field as a VARLEN keyword unless you
specify a value for the allocated-length parameter.</p>
<p>Do not specify the
VARLEN keyword on a date, time, or timestamp field (L, T, or Z in position
35).</p>
</div>
<div class="example"><h4 class="sectiontitle">Example</h4><p>The following example shows how to specify
the VARLEN keyword for a physical file.</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A R RECORD1
00020A FIELD1 100A VARLEN(30)
00030A FIELD2 200A VARLEN
A</pre>
<p>FIELD1 is defined as a variable-length field with a maximum
length of 100 and an allocated length of 30. FIELD2 is defined
as a variable-length field with a maximum length of 200 and no allocated length.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzakbmstlfkeyw.htm" title="This topic lists valid keyword entries for describing physical and logical files. They are typed in positions 45 through 80 (functions).">Keyword entries for physical and logical files (positions 45 through 80)</a></div>
</div>
</div>
</body>
</html>