201 lines
12 KiB
HTML
201 lines
12 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="Select or omit field name" />
|
|
<meta name="abstract" content="Use select or omit fields to tell the operating system how to select or omit records when your program retrieves them using this record format. The only records affected are those from the physical file(s) specified for the PFILE or JFILE keyword for this record format." />
|
|
<meta name="description" content="Use select or omit fields to tell the operating system how to select or omit records when your program retrieves them using this record format. The only records affected are those from the physical file(s) specified for the PFILE or JFILE keyword for this record format." />
|
|
<meta name="DC.subject" content="select/omit field name, logical files" />
|
|
<meta name="keywords" content="select/omit field name, logical files" />
|
|
<meta name="DC.Relation" scheme="URI" content="lfname.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzakbmstlall.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="selectomit" />
|
|
<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>Select or omit field name</title>
|
|
</head>
|
|
<body id="selectomit"><a name="selectomit"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Select or omit field name</h1>
|
|
<div><p>Use select or omit fields to tell the operating system how to select
|
|
or omit records when your program retrieves them using this record format.
|
|
The only records affected are those from the physical file(s) specified for
|
|
the PFILE or JFILE keyword for this record format.</p>
|
|
<div class="section"><div class="p">The following rules apply to select/omit fields in logical files:
|
|
<ul><li>You can specify select/omit fields only if you also specify key fields
|
|
or if you also specify the DYNSLT keyword for the file. You can also specify
|
|
*NONE as a key field to satisfy the requirement for a key field when your
|
|
application requires no key fields.</li>
|
|
<li>For simple and multiple-format logical files, the operating system uses
|
|
the following search order to match select/omit field names with defined fields:
|
|
<ul><li>Fields specified in DDS positions 19 through 28</li>
|
|
<li>Fields specified as parameters on the CONCAT or RENAME keyword</li>
|
|
</ul>
|
|
<p>If the field name is specified more than once, the first occurrence
|
|
is used.</p>
|
|
<p>The field name on a CONCAT or RENAME keyword and the associated
|
|
field name in positions 19 through 28 cannot both be specified as select/omit
|
|
fields.</p>
|
|
<p>The parameter name on the SST keyword is not valid as a select/omit
|
|
field unless it is defined elsewhere in the logical file record format.</p>
|
|
<p>For
|
|
join logical files, the select/omit field name you specify must be specified
|
|
at the field level in positions 19 through 28.</p>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<p>When using the select/omit fields, specify either
|
|
S or O in position 17. By specifying either S or O, the select and omit comparison
|
|
statements are grouped by OR. The system treats the select and omit comparison
|
|
statements that are grouped by OR independently from one another. That is,
|
|
if the select or omit comparison condition is met, the record is either selected
|
|
or omitted. If the condition is not met, the system proceeds to the next comparison.</p>
|
|
<p>By
|
|
specifying a blank in position 17, the select and omit comparison statements
|
|
are ANDed together. The combined comparisons must be met before the record
|
|
is selected or omitted. See <a href="#selectomit__cfig10">Figure 1</a> and <a href="#selectomit__cfig11">Figure 2</a>. In positions 19 through 28, specify a field
|
|
name whose contents at processing time determine whether the record is to
|
|
be selected or omitted based on the select/omit keyword specified for this
|
|
field. The select/omit keywords are COMP, RANGE, and VALUES. The last select/omit
|
|
specification can be made with the ALL keyword, but a field name is not permitted.</p>
|
|
<div class="p">The
|
|
field must appear in both the physical file record format and the logical
|
|
file record format. Select/omit statements must follow all field and key field
|
|
level entries for the record format. You can specify both select and omit
|
|
for the same record format. The following information applies: <ul><li>If you specify both select and omit for a record format, the order in
|
|
which you specify them is important.<p>The select/omit statements are processed
|
|
in the order they are specified; if a record satisfies a statement, the record
|
|
is either selected or omitted as specified, and remaining select/omit statements
|
|
are not examined for that record. See <a href="#selectomit__cfig12">Figure 3</a></p>
|
|
|
|
.</li>
|
|
<li>If you specify both select and omit statements, you can indicate whether
|
|
records not meeting any of the values specified are to be selected or omitted.</li>
|
|
<li>If you do not specify the ALL keyword, the action taken for the records
|
|
that do not meet the values is the converse of the type of the last statement
|
|
specified. Records that do not meet selection values are omitted, and records
|
|
that do not meet omission values are selected.</li>
|
|
</ul>
|
|
</div>
|
|
<div class="p">There are limits to the number of select/omit statements you can
|
|
specify in a single logical file. If you specify many select/omit statements
|
|
and you cannot create the file, reduce the overhead for the file through the
|
|
following changes in the specifications, in decreasing order of importance:
|
|
<ul><li>Reduce the number of record formats in the file.</li>
|
|
<li>Reduce the number of physical files specified on the PFILE or JFILE keyword.</li>
|
|
<li>Reduce the number of fields used (single occurrences) in the select/omit
|
|
specifications.</li>
|
|
</ul>
|
|
</div>
|
|
<p>You cannot specify a floating-point field as a select/omit field.</p>
|
|
<p>It
|
|
is possible to have an access path with select/omit and process the file in
|
|
arrival sequence. For example, CPYF can be specified with FROMRCD(1) or the
|
|
high-level language cannot request keyed processing. In this case, the processing
|
|
is the same as if the DYNSLT keyword had been specified.</p>
|
|
</div>
|
|
<div class="example"><p><a href="#selectomit__cfig10">Figure 1</a> shows
|
|
how to specify the select/omit field using select statements that are grouped
|
|
by AND.</p>
|
|
<div class="fignone" id="selectomit__cfig10"><a name="selectomit__cfig10"><!-- --></a><span class="figcap">Figure 1. Specify the Select/Omit field (example
|
|
1)</span><pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
|
00010A R RECORD1 PFILE(PARTS)
|
|
00020A PNO
|
|
00030A DSC
|
|
00040A UPR
|
|
00050A QOH
|
|
00060A K PNO
|
|
00070A S UPR COMP(GT 5.00)
|
|
00080A QOH COMP(LT 10)
|
|
00090A O ALL
|
|
A</pre>
|
|
</div>
|
|
<p>In <a href="#selectomit__cfig10">Figure 1</a>, records
|
|
are selected only if they satisfy two select statements: the first statement
|
|
selects records in which the value of field UPR is greater than 5.00, and
|
|
the second statement selects records in which the value of field QOH is less
|
|
than 10. S is not specified in position 17 for field QOH. Therefore, these
|
|
select statements are grouped by AND. For a record to be read by a program,
|
|
both conditions specified must be true.</p>
|
|
</div>
|
|
<div class="example"><p><a href="#selectomit__cfig11">Figure 2</a> shows
|
|
how to specify the select/omit field using an omit statement that is grouped
|
|
by OR with two select statements that are grouped by AND.</p>
|
|
<div class="fignone" id="selectomit__cfig11"><a name="selectomit__cfig11"><!-- --></a><span class="figcap">Figure 2. Specify the Select/Omit field (example 2)</span><pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
|
00010A R RECORD1 PFILE(PARTS)
|
|
00020A PNO
|
|
00030A DSC
|
|
00040A UPR
|
|
00050A QOH
|
|
00060A K PNO
|
|
00070A O DSC COMP(EQ 'HAMMER')
|
|
00080A S UPR COMP(GT 5.00)
|
|
00090A QOH COMP(LT 10)
|
|
00100A O ALL
|
|
A</pre>
|
|
</div>
|
|
<div class="p">In <a href="#selectomit__cfig11">Figure 2</a>, records are supplied
|
|
to the program if they pass both of the following tests: <ul><li>The DSC field is not equal to HAMMER.</li>
|
|
<li>The UPR field is greater than 5.00 and the QOH field is less than 10.</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="example"><p><a href="#selectomit__cfig12">Figure 3</a> shows several ways to
|
|
specify the same select/omit logic.</p>
|
|
<div class="fignone" id="selectomit__cfig12"><a name="selectomit__cfig12"><!-- --></a><span class="figcap">Figure 3. Specify the
|
|
Select/Omit field (example 3)</span><pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
|
00010A S ST COMP(EQ 'NY')
|
|
00020A REP COMP(EQ 'JSMITH') <span><span>1</span></span>
|
|
00030A YEAR COMP(LT 78)
|
|
00040A O ALL
|
|
A
|
|
00050A O YEAR COMP(GE 78)
|
|
00060A S ST COMP(EQ 'NY') <span><span>2</span></span>
|
|
00070A REP COMP(EQ 'JSMITH')
|
|
00080A O ALL
|
|
A
|
|
00090A O REP COMP(NE 'JSMITH')
|
|
00100A O ST COMP(NE 'NY') <span><span>3</span></span>
|
|
00110A S YEAR COMP(LT 78)
|
|
00120A O ALL
|
|
A</pre>
|
|
</div>
|
|
<div class="p">In <a href="#selectomit__cfig12">Figure 3</a>, you
|
|
want to select all the records before 1978 for a marketing representative
|
|
named JSMITH in the state of New York. There are three ways to code this example:
|
|
<ol><li>All records must be compared with the select fields ST, REP, and YEAR
|
|
before they can be selected or omitted.</li>
|
|
<li>All records in and after 1978 are omitted in the first comparison. Then,
|
|
only the records before 1978 are compared with ST and REP. Only two select
|
|
fields must be satisfied. This way is more efficient than method 1.</li>
|
|
<li>All records that are not associated with JSMITH in the state of New York
|
|
are omitted in the first and second comparisons. Then, all records left are
|
|
compared to YEAR. This is more efficient than method 1 or method 2.</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="lfname.htm" title="Use these positions to specify record or field names.">Name for physical and logical files (positions 19 through 28)</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="rzakbmstlall.htm" title="Use this select/omit field-level keyword to specify the action to be taken after all other select/omit specifications have been processed for this logical file.">ALL (All) keyword—logical files only</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |