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

160 lines
9.8 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="DFT (Default) keyword—physical files only" />
<meta name="abstract" content="Use this field-level keyword to specify a default value for a field." />
<meta name="description" content="Use this field-level keyword to specify a default value for a field." />
<meta name="DC.subject" content="DFT (Default) keyword, Default (DFT) keyword" />
<meta name="keywords" content="DFT (Default) keyword, Default (DFT) keyword" />
<meta name="DC.Relation" scheme="URI" content="rzakbmstlfkeyw.htm" />
<meta name="DC.Relation" scheme="URI" content="lfusg.htm" />
<meta name="DC.Relation" scheme="URI" content="rzakbmsttdjdftv.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="pdft" />
<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, DFT</title>
</head>
<body id="pdft"><a name="pdft"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">DFT (Default) keyword—physical files only</h1>
<div><p>Use this field-level keyword to specify a default value for a field.</p>
<div class="section"><div class="p">The format of the keyword is: <pre>DFT('value' | numeric-value | X'hexadecimal-value' | *NULL)</pre>
</div>
<p>Without this keyword, character and hexadecimal fields are
set to blanks as default and numeric fields are set to zeros as default. However,
if you specify the ALWNULL keyword for the field, then the character, hexadecimal,
and numeric fields are set to the null value as default.</p>
<div class="p">The
following rules apply to the specified value: <ul><li>If the field being defined is a character field, specify a character constant,
hexadecimal value, or *NULL. Specify character strings within single quotation marks.
If the field is variable length (VARLEN), then the length of the string must
be less than or equal to the allocated length. <p>Specify hexadecimal values
as an X followed by a combination of the digits 0 through 9 and the letters
A through F. Enclose the combination in single quotation marks. The number of hexadecimal
digits in single quotation marks must be exactly twice the specified length of the field.
If the field is variable length (VARLEN), then the number of hexadecimal digits
in single quotation marks must be exactly twice the allocated length.</p>
</li>
<li>If the field being defined is a hexadecimal field, specify a character
constant, hexadecimal value, or *NULL. <div class="note"><span class="notetitle">Note:</span> If a character constant is specified,
the hexadecimal representation of the character constant is the default value.</div>
<p>Specify
character strings within single quotation marks. If the field is variable length (VARLEN),
then the length of the string must be less than or equal to the allocated
length.</p>
<p>Specify hexadecimal values as an X followed by a combination
of the digits 0 through 9 and the letters A through F. Enclose the combination
in single quotation marks. The number of hexadecimal digits in single quotation marks must be exactly
twice the specified length of the field. If the field is variable length (VARLEN),
then the number of hexadecimal digits in single quotation marks must be exactly twice
the allocated length.</p>
</li>
<li>If you are defining a numeric field, specify a numeric value (digits 0
through 9 specified without single quotation marks) or *NULL. For a value other than
zero in positions 36 and 37, specify the decimal character with a numeric
constant in the appropriate position in the DDS.</li>
<li>If you specify *NULL, then you must also specify the ALWNULL keyword on
the field.</li>
<li>If you do not specify any value (DFT('')), this indicates a default of
a 0 length string and is valid only when the field is variable length (the
VARLEN keyword must also be specified).</li>
<li>If you are defining a date field, specify a valid date in the same format
specified on the DATFMT keyword and use the same separator as specified on
the DATSEP keyword. For example, <samp class="codeph">DFT('12/15/91')</samp> is the default
value if *MDY is specified for DATFMT and '/' is specified for DATSEP. <p>If
the DFT keyword is not specified, the default value is the current date.</p>
</li>
<li>If you are defining a time field, specify a valid time in the same format
specified on the TIMFMT keyword and use the same separator as specified on
the TIMSEP keyword. For example, <samp class="codeph">DFT('11.00.00')</samp> is the default
value if *ISO is specified for TIMFMT. The default separator for *ISO is a
period (.). <p>If the DFT keyword is not specified, the default value is
the current time.</p>
</li>
<li>If you are defining a timestamp field, you must specify the default value
in the following format: <pre>DFT('YYYY-MM-DD-HH.MM.SS.UUUUUU')</pre>
<p>If
the DFT keyword is not specified, the default value is the current time.</p>
</li>
</ul>
</div>
<div class="p">The value specified is assigned to the field in the following
cases: <ul><li>When the program does an output operation to a logical file based on this
physical file and the record format in the logical file does not name this
field.</li>
<li>When
you use the Initialize Physical File Member (INZPFM) command for a member
in this file.</li>
<li>When you use the Copy File (CPYF) command with FMTOPT(*MAP) specified
and a field in the to-file is not in the from-file.</li>
</ul>
</div>
<div class="p">The specified value is supplied to the program
when the program does an input operation to a join logical file and all of
the following situations are true: <ul><li>You specify the JDFTVAL keyword for the join logical file.</li>
<li>The file being defined is specified as a secondary file in the join logical
file.</li>
<li>When the input operation occurs and the link to the secondary file produces
no records.</li>
</ul>
</div>
<p>This keyword does not affect the physical file on input operations.</p>
</div>
<div class="example"><h4 class="sectiontitle">Example</h4><p>The following example shows how to specify
the DFT keyword.</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A R RECORD1
00020A CHARFLD1 20A DFT('Sample field')
00030A CHARFLD2 5A DFT(X'D985955185')
00040A HEXFLD1 3H DFT('ABC')
00050A HEXFLD2 3H DFT(X'C1C2C3')
00060A NUMFLD1 5S 0 DFT(99999)
00070A NUMFLD2 5S 2 DFT(999.99)
00080A NUMFLD3 5S 2 DFT(999)
00090A NUMFLD4 5S 2 DFT(*NULL)
00100A ALWNULL
00110A NUMFLD5 5S 2 DFT(999.99)
00120A ALWNULL
00130A DATFLD1 L DATFMT(*MDY) DATSEP('-')
00140A DFT('12-31-91')
00150A TIMFLD1 T DFT('11.15.00')
A</pre>
<p>The default value for CHARFLD1 is 'Sample field'. The
default value for CHARFLD2 is hex D985955185. The default value for HEXFLD1
is C1C2C3 (the hexadecimal representation of the character constant). The
default value for HEXFLD2 is C1C2C3. The default value for NUMFLD1 is 99999
(no decimal character is required because the field has zero decimal positions).
The default value for NUMFLD2 is 999.99. The default value for NUMFLD3 is
999 (no decimal character is required if you do not need to specify decimal
values). The default value for NUMFLD4 is the null value (ALWNULL is a required
keyword for the field if DFT(*NULL) is specified). The default value for NUMFLD5
is 999.99; the field also allows the null value. The default value for DATFLD1
is 12-31-91. The default value for TIMFLD1 is 11.15.00 (*ISO format).</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 class="relref"><strong>Related reference</strong><br />
<div><a href="lfusg.htm" title="Use this field to specify that a named field is to be an input-only, both (both input and output are allowed), or neither field.">Usage for physical and logical files (position 38)</a></div>
<div><a href="rzakbmsttdjdftv.htm" title="Use this file-level keyword in a join logical file so the system provides default values for fields when a join to a secondary file does not produce any records. JDFTVAL is valid only for join logical files.">JDFTVAL (Join Default Values) keyword—join logical files only</a></div>
</div>
</div>
</body>
</html>