1728 lines
86 KiB
HTML
1728 lines
86 KiB
HTML
|
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Open Query File (OPNQRYF)</title>
|
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<a name="OPNQRYF.Top_Of_Page"></a>
|
|
<h2>Open Query File (OPNQRYF)</h2>
|
|
<table width="100%">
|
|
<tr>
|
|
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
|
|
<b>Threadsafe: </b>Conditional
|
|
</td>
|
|
<td valign="top" align="right">
|
|
<a href="#OPNQRYF.PARAMETERS.TABLE">Parameters</a><br>
|
|
<a href="#OPNQRYF.COMMAND.EXAMPLES">Examples</a><br>
|
|
<a href="#OPNQRYF.ERROR.MESSAGES">Error messages</a></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<div> <a name="OPNQRYF"></a>
|
|
<p>The Open Query File (OPNQRYF) command opens a file to a set of database records that satisfies a database query request. Once opened, the file looks like a database file opened using the Open Database File (OPNDBF) command, and the records in the file are accessed by high-level language programs that share the open data path (ODP). The path is closed, and all query resources are deallocated, using the Close File (CLOF) command.
|
|
</p>
|
|
<p>This command is used to do any combination of the following database functions:
|
|
</p>
|
|
<ul>
|
|
<li>Join records from more than one file, member, and record format. The join may be either equal or non-equal in nature.
|
|
</li>
|
|
<li>Calculate new field values using numeric and character operations on field values and constants.
|
|
</li>
|
|
<li>Group records by like values of one or more fields, and calculate aggregate functions, such as minimum field value and average field value, for each group.
|
|
</li>
|
|
<li>Select a subset of the available records, with selection both before and after grouping the records.
|
|
</li>
|
|
<li>Arrange result records by the value of one or more key fields.
|
|
</li>
|
|
</ul>
|
|
<p><b>Restrictions:</b>
|
|
</p>
|
|
<ol>
|
|
<li>The user can use overrides to change the file, library, and member names specified for the FILE parameter. Overrides are ignored for the file and library specified for the FORMAT parameter, unless FORMAT(*FILE) is specified. Parameter values specified on an override command, other than TOFILE, MBR, LVLCHK, WAITRCD, SEQONLY, or INHWRT and SHARE, are ignored by the OPNQRYF command.
|
|
</li>
|
|
<li>The OPNQRYF command does not share an existing open data path (ODP) in the job or activation group. If an existing SHARE(*YES) ODP in the job or activation group has the same file, library, and member name as the open query file open data path (ODP), the query file does not open and an escape message is sent.
|
|
</li>
|
|
<li>Each subsequent shared open operation must use the same open options (such as SEQONLY) that are in effect when the OPNQRYF command is run.
|
|
</li>
|
|
<li>Some system functions (such as the Display Physical File Member (DSPPFM) and Copy File (CPYF) commands) do not share an existing open data path. The OPNQRYF command cannot be used with those functions.
|
|
</li>
|
|
<li>The file opened with the OPNQRYF command cannot be used in programs written in BASIC because BASIC does not share an existing open data path.
|
|
</li>
|
|
<li>This command is conditionally threadsafe. In multithreaded jobs, this command is not threadsafe for distributed files and fails for distributed files that use relational databases of type *SNA. This command is also not threadsafe and fails for Distributed Data Management (DDM) files of type *SNA.
|
|
</li>
|
|
<li>Users of this command must have the following authorities:
|
|
<ul>
|
|
<li>Execute (*EXECUTE) authority for any library that is needed to locate the files specified for the FILE and FORMAT parameters
|
|
</li>
|
|
<li>Object operational (*OBJOPR) authority for any physical or logical file specified for the FILE parameter, and one or more of the following data authorities for the physical file or based-on physical file members of a logical file member:
|
|
<ul>
|
|
<li>Read (*READ) authority if the file is opened for input (using option *INP)
|
|
</li>
|
|
<li>Add (*ADD) authority if the file is opened for output (using option *OUT)
|
|
</li>
|
|
<li>Update (*UPD) authority if the file is opened for updates (using option *UPD)
|
|
</li>
|
|
<li>Delete (*DLT) authority if the file is opened for deletions (using option *DLT)
|
|
</li>
|
|
<li>*READ, *ADD, *UPD, and *DLT authority if the file is opened for all I/O operations (using option *ALL)
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>*OBJOPR authority for any file specified for the FORMAT parameter
|
|
</li>
|
|
<li>Use (*USE) authority for any translate tables specified for the MAPFLD parameter (using option *USE)
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ol>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<hr size="2" width="100%">
|
|
|
|
<div>
|
|
<h3><a name="OPNQRYF.PARAMETERS.TABLE">Parameters</a></h3>
|
|
<table border="1" cellpadding="4" cellspacing="0">
|
|
<!-- col1="10" col2="15" col3="30" col4="10" -->
|
|
<tr>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" rowspan="6"><a href="#OPNQRYF.FILE"><b>FILE</b></a></td>
|
|
<td valign="top">File specifications</td>
|
|
<td valign="top">Values (up to 32 repetitions): <i>Element list</i></td>
|
|
<td valign="top" rowspan="6">Required, Positional 1</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 1: File</td>
|
|
<td valign="top">
|
|
<i>Qualified object name</i></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" style="padding-left:10pt">Qualifier 1: File</td>
|
|
<td valign="top"><i>Name</i></td>
|
|
</tr><tr>
|
|
<td valign="top" style="padding-left:10pt">Qualifier 2: Library</td>
|
|
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
|
|
</tr><tr>
|
|
<td valign="top">Element 2: Member</td>
|
|
<td valign="top">
|
|
<i>Name</i>, <b><u>*FIRST</u></b>, *LAST, *ALL</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 3: Record format</td>
|
|
<td valign="top">
|
|
<i>Name</i>, <b><u>*ONLY</u></b></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.OPTION"><b>OPTION</b></a></td>
|
|
<td valign="top">Open options</td>
|
|
<td valign="top">Single values: *ALL<br>Other values (up to 4 repetitions): <b><u>*INP</u></b>, *OUT, *UPD, *DLT</td>
|
|
<td valign="top">Optional, Positional 2</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" rowspan="5"><a href="#OPNQRYF.FORMAT"><b>FORMAT</b></a></td>
|
|
<td valign="top">Format specifications</td>
|
|
<td valign="top">Single values: <b><u>*FILE</u></b><br>Other values: <i>Element list</i></td>
|
|
<td valign="top" rowspan="5">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 1: File</td>
|
|
<td valign="top">
|
|
<i>Qualified object name</i></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" style="padding-left:10pt">Qualifier 1: File</td>
|
|
<td valign="top"><i>Name</i></td>
|
|
</tr><tr>
|
|
<td valign="top" style="padding-left:10pt">Qualifier 2: Library</td>
|
|
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
|
|
</tr><tr>
|
|
<td valign="top">Element 2: Record format</td>
|
|
<td valign="top">
|
|
<i>Name</i>, <b><u>*ONLY</u></b></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.QRYSLT"><b>QRYSLT</b></a></td>
|
|
<td valign="top">Query selection expression</td>
|
|
<td valign="top"><i>Character value</i>, <b><u>*ALL</u></b></td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" rowspan="6"><a href="#OPNQRYF.KEYFLD"><b>KEYFLD</b></a></td>
|
|
<td valign="top">Key field specifications</td>
|
|
<td valign="top">Single values: <b><u>*NONE</u></b>, *FILE<br>Other values (up to 50 repetitions): <i>Element list</i></td>
|
|
<td valign="top" rowspan="6">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 1: Key field</td>
|
|
<td valign="top">
|
|
<i>Qualified object name</i></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" style="padding-left:10pt">Qualifier 1: Key field</td>
|
|
<td valign="top"><i>Name</i></td>
|
|
</tr><tr>
|
|
<td valign="top" style="padding-left:10pt">Qualifier 2: File or element</td>
|
|
<td valign="top"><i>Name</i>, *MAPFLD, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32</td>
|
|
</tr><tr>
|
|
<td valign="top">Element 2: Key field order</td>
|
|
<td valign="top">
|
|
<b><u>*ASCEND</u></b>, *DESCEND</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 3: Order by absolute value</td>
|
|
<td valign="top">
|
|
*ABSVAL</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.UNIQUEKEY"><b>UNIQUEKEY</b></a></td>
|
|
<td valign="top">Unique key fields</td>
|
|
<td valign="top">1-120, <b><u>*NONE</u></b>, *ALL</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" rowspan="8"><a href="#OPNQRYF.JFLD"><b>JFLD</b></a></td>
|
|
<td valign="top">Join field specifications</td>
|
|
<td valign="top">Single values: <b><u>*NONE</u></b><br>Other values (up to 50 repetitions): <i>Element list</i></td>
|
|
<td valign="top" rowspan="8">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 1: From field</td>
|
|
<td valign="top">
|
|
<i>Qualified object name</i></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" style="padding-left:10pt">Qualifier 1: From field</td>
|
|
<td valign="top"><i>Name</i></td>
|
|
</tr><tr>
|
|
<td valign="top" style="padding-left:10pt">Qualifier 2: File or element</td>
|
|
<td valign="top"><i>Name</i>, *MAPFLD, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32</td>
|
|
</tr><tr>
|
|
<td valign="top">Element 2: To field</td>
|
|
<td valign="top">
|
|
<i>Qualified object name</i></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" style="padding-left:10pt">Qualifier 1: To field</td>
|
|
<td valign="top"><i>Name</i></td>
|
|
</tr><tr>
|
|
<td valign="top" style="padding-left:10pt">Qualifier 2: File or element</td>
|
|
<td valign="top"><i>Name</i>, *MAPFLD, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32</td>
|
|
</tr><tr>
|
|
<td valign="top">Element 3: Join operator</td>
|
|
<td valign="top">
|
|
<b><u>*EQ</u></b>, *NE, *LT, *GT, *LE, *GE</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.JDFTVAL"><b>JDFTVAL</b></a></td>
|
|
<td valign="top">Join with default values</td>
|
|
<td valign="top"><b><u>*NO</u></b>, *YES, *ONLYDFT</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.JORDER"><b>JORDER</b></a></td>
|
|
<td valign="top">Join file order</td>
|
|
<td valign="top"><b><u>*ANY</u></b>, *FILE</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" rowspan="3"><a href="#OPNQRYF.GRPFLD"><b>GRPFLD</b></a></td>
|
|
<td valign="top">Grouping field names</td>
|
|
<td valign="top">Single values: <b><u>*NONE</u></b><br>Other values (up to 50 repetitions): <i>Qualified object name</i></td>
|
|
<td valign="top" rowspan="3">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Qualifier 1: Grouping field names</td>
|
|
<td valign="top"><i>Name</i></td>
|
|
</tr><tr>
|
|
<td valign="top">Qualifier 2: File or element</td>
|
|
<td valign="top"><i>Name</i>, *MAPFLD, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32</td>
|
|
</tr><tr>
|
|
<td valign="top"><a href="#OPNQRYF.GRPSLT"><b>GRPSLT</b></a></td>
|
|
<td valign="top">Group selection expression</td>
|
|
<td valign="top"><i>Character value</i>, <b><u>*ALL</u></b></td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" rowspan="7"><a href="#OPNQRYF.MAPFLD"><b>MAPFLD</b></a></td>
|
|
<td valign="top">Mapped field specifications</td>
|
|
<td valign="top">Single values: <b><u>*NONE</u></b><br>Other values (up to 50 repetitions): <i>Element list</i></td>
|
|
<td valign="top" rowspan="7">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 1: Mapped field</td>
|
|
<td valign="top">
|
|
<i>Name</i></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 2: Field definition expression</td>
|
|
<td valign="top">
|
|
<i>Character value</i></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 3: Mapped field type</td>
|
|
<td valign="top">
|
|
<b><u>*CALC</u></b>, *BIN2, *BIN4, *FLT4, *FLT8, *DEC, *ZONED, *CHAR, *VCHAR, *HEX, *VHEX, *DATE, *TIME, *TIMESTP, *ONLY, *VONLY, *OPEN, *VOPEN, *EITHER, *VEITHER, *GRAPHIC, *VGRAPHIC</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 4: Length</td>
|
|
<td valign="top">
|
|
0-32766</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 5: Decimal positions</td>
|
|
<td valign="top">
|
|
0-63</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 6: Mapped field CCSID</td>
|
|
<td valign="top">
|
|
1-65535, <b><u>*CALC</u></b>, *HEX</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.IGNDECERR"><b>IGNDECERR</b></a></td>
|
|
<td valign="top">Ignore decimal data errors</td>
|
|
<td valign="top"><b><u>*NO</u></b>, *YES</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.OPNID"><b>OPNID</b></a></td>
|
|
<td valign="top">Open file identifier</td>
|
|
<td valign="top"><i>Name</i>, <b><u>*FILE</u></b></td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" rowspan="3"><a href="#OPNQRYF.SEQONLY"><b>SEQONLY</b></a></td>
|
|
<td valign="top">Limit to sequential only</td>
|
|
<td valign="top">Single values: *NO<br>Other values: <i>Element list</i></td>
|
|
<td valign="top" rowspan="3">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 1: Sequential only</td>
|
|
<td valign="top">
|
|
<b><u>*YES</u></b></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 2: Number of records</td>
|
|
<td valign="top">
|
|
1-32767</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.COMMIT"><b>COMMIT</b></a></td>
|
|
<td valign="top">Commitment control active</td>
|
|
<td valign="top"><b><u>*NO</u></b>, *YES</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.OPNSCOPE"><b>OPNSCOPE</b></a></td>
|
|
<td valign="top">Open scope</td>
|
|
<td valign="top"><b><u>*ACTGRPDFN</u></b>, *ACTGRP, *JOB</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.DUPKEYCHK"><b>DUPKEYCHK</b></a></td>
|
|
<td valign="top">Duplicate key check</td>
|
|
<td valign="top"><b><u>*NO</u></b>, *YES</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.ALWCPYDTA"><b>ALWCPYDTA</b></a></td>
|
|
<td valign="top">Allow copy of data</td>
|
|
<td valign="top"><b><u>*YES</u></b>, *OPTIMIZE, *NO</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" rowspan="3"><a href="#OPNQRYF.OPTIMIZE"><b>OPTIMIZE</b></a></td>
|
|
<td valign="top">Performance optimization</td>
|
|
<td valign="top">Single values: <b><u>*ALLIO</u></b>, *MINWAIT<br>Other values: <i>Element list</i></td>
|
|
<td valign="top" rowspan="3">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 1: Performance optimization</td>
|
|
<td valign="top">
|
|
<b><u>*FIRSTIO</u></b></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Element 2: Number of records</td>
|
|
<td valign="top">
|
|
1-2147483647</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.OPTALLAP"><b>OPTALLAP</b></a></td>
|
|
<td valign="top">Optimize all access paths</td>
|
|
<td valign="top"><b><u>*NO</u></b>, *YES</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" rowspan="3"><a href="#OPNQRYF.SRTSEQ"><b>SRTSEQ</b></a></td>
|
|
<td valign="top">Sort sequence</td>
|
|
<td valign="top">Single values: *HEX, <b><u>*JOB</u></b>, *LANGIDSHR, *LANGIDUNQ<br>Other values: <i>Qualified object name</i></td>
|
|
<td valign="top" rowspan="3">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top">Qualifier 1: Sort sequence</td>
|
|
<td valign="top"><i>Name</i></td>
|
|
</tr><tr>
|
|
<td valign="top">Qualifier 2: Library</td>
|
|
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
|
|
</tr><tr>
|
|
<td valign="top"><a href="#OPNQRYF.LANGID"><b>LANGID</b></a></td>
|
|
<td valign="top">Language ID</td>
|
|
<td valign="top"><i>Name</i>, <b><u>*JOB</u></b></td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.CCSID"><b>CCSID</b></a></td>
|
|
<td valign="top">Final output CCSID</td>
|
|
<td valign="top">1-65535, <b><u>*JOB</u></b>, *HEX</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#OPNQRYF.TYPE"><b>TYPE</b></a></td>
|
|
<td valign="top">Type of open</td>
|
|
<td valign="top"><b><u>*NORMAL</u></b>, *PERM</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
</div>
|
|
<div> <a name="OPNQRYF.FILE"></a>
|
|
<h3>File specifications (FILE)</h3>
|
|
<p>Specifies one or more files, members, and record formats processed by the open query file. All files specified must be physical or logical database files, or Distributed Data Management (DDM) files. If Distributed Data Management files are used, all files they refer to must be on the same target system.
|
|
</p>
|
|
<p>When more than one file, member, and record format is specified, the query joins field values to create a single set of records. Any file specified in the list may be a join logical file or view logical file member. More information on view logical files is in SQL Reference information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
|
|
</p>
|
|
<p>You can specify 32 values for this parameter.
|
|
</p>
|
|
<p>This is a required parameter.
|
|
</p>
|
|
<p><b>Element 1: File</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b></b></dt>
|
|
<dd>
|
|
<p><b>Qualifier 1: File</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the file to be processed.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><b></b></dt>
|
|
<dd>
|
|
<p><b>Qualifier 2: Library</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*LIBL</u></b></dt>
|
|
<dd>The library list is used to locate the database file.
|
|
</dd>
|
|
<dt><b>*CURLIB</b></dt>
|
|
<dd>The current library for the job is used to locate the database file. If no library is specified as the current library for the job, QGPL is used.
|
|
</dd>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the library where the database file is located.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 2: Member</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*FIRST</u></b></dt>
|
|
<dd>The oldest member created is to be used.
|
|
</dd>
|
|
<dt><b>*LAST</b></dt>
|
|
<dd>The newest member created is to be used.
|
|
</dd>
|
|
<dt><b>*ALL</b></dt>
|
|
<dd>All members of a partition file are to be used.
|
|
</dd>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the database file member to be used.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 3: Record format</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*ONLY</u></b></dt>
|
|
<dd>The only record format in the file is to be used. If the file has more than one record format, a record format name must be specified.
|
|
</dd>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the record format to be used. The record format must exist in the database file specified in the first element of this parameter.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.OPTION"></a>
|
|
<h3>Open options (OPTION)</h3>
|
|
<p>Specifies the open option used for the query file. The options chosen on the first full open of a file are not changed on subsequent shared opens. You can either specify *ALL or a value that combines *INP, *OUT, *UPD, and *DLT in a list of up to four values in any order.
|
|
</p>
|
|
<p><b>Single values</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>*ALL</b></dt>
|
|
<dd>Open the file for all operations (*INP, *OUT, *UPD, *DLT).
|
|
</dd>
|
|
</dl>
|
|
<p><b>Other values (up to 4 repetitions)</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*INP</u></b></dt>
|
|
<dd>Open the file for input. *INP is the only value allowed if join processing or group processing is requested, if UNIQUEKEY processing is specified, if all the fields in the open query file record format specified for the <b>Format specifications (FORMAT)</b> parameter are for input-only use, or if a temporary file is required to run the query.
|
|
</dd>
|
|
<dt><b>*OUT</b></dt>
|
|
<dd>Open the file for output. In some high-level languages, output to certain files (such as files defined as 'direct access' in the high-level language program) is done by using a combination of input and update operations. *UPD and *INP are specified, or *ALL is specified, in order to use an open query file with such a program.
|
|
</dd>
|
|
<dt><b>*UPD</b></dt>
|
|
<dd>Open the file for update operations. If an input operation comes before an update, you must specify *INP when *UPD is specified.
|
|
</dd>
|
|
<dt><b>*DLT</b></dt>
|
|
<dd>Open the file for delete operations. If a delete operation is preceded by an input operation, you must specify *INP when *DLT is specified.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.FORMAT"></a>
|
|
<h3>Format specifications (FORMAT)</h3>
|
|
<p>Specifies the record format used for records available through the open query file. The simple field names in the open query file record format must represent fields that are either defined on the <b>Mapped field specifications (MAPFLD)</b> parameter or are unique across all files, members, and record formats specified on the <b>File specifications (FILE)</b> parameter. The value for any field that has the same name as a field specified on the MAPFLD parameter is determined by the mapped-field-definition on the MAPFLD parameter. The value for any field not defined on the MAPFLD parameter is determined by a mapping of the field with the same name in one of the based-on files, members, and record formats specified for the FILE parameter. Only the name, type, length, decimal positions, keyboard shift, and usage attributes of each field specified in the record format that is identified on the <b>Format specifications (FORMAT)</b> parameter are used for the open query file. All other attributes are ignored. The attributes do not have to be the same. If they differ, the fields are mapped in a way similar to the Change Variable (CHGVAR) command.
|
|
</p>
|
|
<p><b>Single values</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*FILE</u></b></dt>
|
|
<dd>The record format of the first or only entry on the <b>File specifications (FILE)</b> parameter is used. *FILE is not allowed when more than one file, member, and record format are specified on the FILE parameter (requiring a join query).
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 1: File</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b></b></dt>
|
|
<dd>
|
|
<p><b>Qualifier 1: File</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of a physical or logical database file, or a Distributed Data Management (DDM) file that contains the record format to be used.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><b></b></dt>
|
|
<dd>
|
|
<p><b>Qualifier 2: Library</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*LIBL</u></b></dt>
|
|
<dd>The library list is used to locate the database file.
|
|
</dd>
|
|
<dt><b>*CURLIB</b></dt>
|
|
<dd>The current library for the job is used to locate the database file. If no library is specified as the current library for the job, QGPL is used.
|
|
</dd>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the library where the database file is located.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 2: Record format</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*ONLY</u></b></dt>
|
|
<dd>The only record format in the file is used. If no record format name is specified, *ONLY is the default. If the file has more than one record format, a record format name must be specified.
|
|
</dd>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the record format to be used. The record format must exist in the database file specified for the first element of this parameter.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.QRYSLT"></a>
|
|
<h3>Query selection expression (QRYSLT)</h3>
|
|
<p>Specifies the selection values used (before grouping) to determine the records that are available through the open query file.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*ALL</u></b></dt>
|
|
<dd>All records in the physical or logical files, members, and record formats specified for the <b>File specifications (FILE)</b> parameter (after join processing, if required) are selected.
|
|
</dd>
|
|
<dt><b><i>'query-selection'</i></b></dt>
|
|
<dd>Specify an expression (contained in apostrophes) that describes the values used to determine which records are selected. You can specify any logical expression formed from relationships (such as *EQ and *NE) of field and constant values or functions of field and constant values. At least one field name is specified in each relationship. However, you cannot specify a field that depends on an aggregate function (either directly in its definition or indirectly by referring to a mapped field).
|
|
<p>Each field name may be qualified with either a file name or number that indicates which element in the list of files, members, and record formats specified for the FILE parameter contains the field. The specified value *MAPFLD may be used to qualify the field name if the field is defined on the <b>Mapped field specifications (MAPFLD)</b> parameter.
|
|
</p>
|
|
<p>For more information on data type compatibility, see Database information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.KEYFLD"></a>
|
|
<h3>Key field specifications (KEYFLD)</h3>
|
|
<p>Specifies the name of one or more key fields that are used to arrange the query records, or specifies that the access path sequence of the first or only file, member, and record format specified for the <b>File specifications (FILE)</b> parameter is used to arrange the query records. If key field names are specified, you also indicate whether the part of the key associated with each key field is ascending or descending, and whether the records are arranged by the absolute value of a numeric key field. If the key field specified is a double-byte (DBCS) field, the data is arranged in a single-byte sequence.
|
|
</p>
|
|
<p><b>Single values</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NONE</u></b></dt>
|
|
<dd>No key fields are used to arrange the query records; therefore, any arrangement is acceptable. It is even possible for the system to give query records in a different arrangement if the same query is run twice, based on such factors as the current number of records in the file members queried. *NONE allows the system more flexibility to improve the performance of processing records through the open query file.
|
|
</dd>
|
|
<dt><b>*FILE</b></dt>
|
|
<dd>The query records have the same arrangement as the first file, member, and record format specified for the <b>File specifications (FILE)</b> parameter. *FILE can be specified even if the first file in the list has only an arrival sequence access path, in which case the query record arrangement matches the arrival sequence of the first file, member, and record format specified for the FILE parameter.
|
|
<p>When KEYFLD(*FILE) is specified, and a sort sequence other than *HEX has been specified for the SRTSEQ parameter, you may receive your records in an order that does not reflect the true file order. If the file is keyed, the sort sequence is applied to the key fields of the file. If the file has a sort sequence table or an alternative collating sequence table, ordering is ignored. This allows users to indicate which fields to apply a sort sequence to without having to list all the field names. If a sort sequence is not specified for the query, the query is ordered as in releases previous to V2R3M0.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 1: Key field</b>
|
|
</p>
|
|
<p>Specify one or more field names (a maximum of 50 field names can be specified) to be used to define a keyed access path to arrange the query records. Each field name may be qualified with either a file name or number that indicates which element value in the list of files, members, and record formats specified for the <b>File specifications (FILE)</b> parameter contains the field. The special value *MAPFLD may also be used to qualify the field name if the field is defined on the <b>Mapped field specifications (MAPFLD)</b> parameter.
|
|
</p>
|
|
<p>The sum of the lengths of all key fields cannot be more than 10000 bytes. In addition, if the sum of the lengths of the key fields is greater than 2000 bytes, *INP must be specified for theOPTION parameter and fields cannot be ordered by their absolute value.
|
|
</p>
|
|
<p>
|
|
<b>Note: </b>The limits noted above are reduced by 2 bytes for each variable-length key field used. For instance, if three key fields are variable-length, the sum of the lengths of all key fields cannot exceed 9994 bytes, since 10000 bytes - (3 variable-length fields * 2 bytes per field) = 9994 bytes.
|
|
</p>
|
|
<dl>
|
|
<dt><b></b></dt>
|
|
<dd>
|
|
<p><b>Qualifier 1: Key field</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the field to be used as a key field.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><b></b></dt>
|
|
<dd>
|
|
<p><b>Qualifier 2: File or element</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>*MAPFLD</b></dt>
|
|
<dd>The field is defined on the MAPFLD parameter.
|
|
</dd>
|
|
<dt><b>1-32</b></dt>
|
|
<dd>Specify the position of the element list value for the FILE parameter to be used. The element list value identifies the database file, file member, and record format to be used.
|
|
</dd>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of a database file specified for the FILE parameter.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 2: Key field order</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*ASCEND</u></b></dt>
|
|
<dd>The part of the key defined by the specified key field is ordered by ascending key values.
|
|
</dd>
|
|
<dt><b>*DESCEND</b></dt>
|
|
<dd>The part of the key defined by the specified key field is ordered by descending key values.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 3: Order by absolute value</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>*ABSVAL</b></dt>
|
|
<dd>The part of the key defined by the specified key field is arranged by the absolute value of the key field. *ABSVAL is specified together with either *ASCEND or *DESCEND, but it is ignored if the key field is not numeric. If *ABSVAL is not specified, the records are arranged by the signed value of a numeric key field.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.UNIQUEKEY"></a>
|
|
<h3>Unique key fields (UNIQUEKEY)</h3>
|
|
<p>Specifies whether the query is restricted to records with unique key values, and specifies how many of the key fields must be unique. If *ALL or a number is specified for this parameter, null values are considered equal.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NONE</u></b></dt>
|
|
<dd>The key fields specified for the <b>Key field specifications (KEYFLD)</b> parameter are not required to be unique. All query records are available through the open query file, regardless of key value.
|
|
</dd>
|
|
<dt><b>*ALL</b></dt>
|
|
<dd>All key fields specified for the KEYFLD parameter must be unique. If there are multiple query records with the same values for all of the key fields, only the first such record is available through the open query file.
|
|
</dd>
|
|
<dt><b><i>1-120</i></b></dt>
|
|
<dd>Specify the number of key fields, ranging from 1 through 120, that is unique. This value must be no larger than the number of key fields determined by the KEYFLD parameter. If there are multiple query records with the same value for the specified number of consecutive key fields, only the first such record is available through the open query file.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.JFLD"></a>
|
|
<h3>Join field specifications (JFLD)</h3>
|
|
<p>Specifies whether the query joins records from multiple file members, and specifies how to join field values from the files, members, and record formats specified for the <b>File specifications (FILE)</b> parameter in constructing the query records.
|
|
</p>
|
|
<p>The first file, member, and record format specified for the FILE parameter is called the join primary, and all other element list values specified for the FILE parameter are called join secondaries. This parameter specifies a list of pairs of field names, in which the first field in each pair provides a value that is used to select records in a join secondary that have the same value in the second field name of the pair.
|
|
</p>
|
|
<p>The join from-field and to-field may be mapped fields (specified for the <b>Mapped field specifications (MAPFLD)</b> parameter), but you cannot use a field that depends on an aggregate function either directly in its definition or indirectly by referring to a mapped field.
|
|
</p>
|
|
<p>The join from-field and to-field are not required to have identical field attributes. For more information on data type compatibility, see Database information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
|
|
</p>
|
|
<p>If more than one file is specified for the FILE parameter, *NO is specified for the <b>Join with default values (JDFTVAL)</b> parameter and *ANY is specified for the <b>Join file order (JORDER)</b> parameter, then the system takes information from the <b>Join field specifications (JFLD)</b> parameter and the <b>Query selection expression (QRYSLT)</b> parameter and derives the final join specifications. If you specify a file on the FILE parameter that is not referred to on the QRYSLT parameter or the JFLD parameter, all records for that file are logically joined to all other records created from the other files specified for the FILE parameter.
|
|
</p>
|
|
<p>If either *YES or *ONLYDFT is specified for the JDFTVAL parameter, or *FILE is specified for the JORDER parameter, the join fields must be specified for the JFLD parameter.
|
|
</p>
|
|
<p>Up to 50 join field pairs can be specified.
|
|
</p>
|
|
<p><b>Single values</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NONE</u></b></dt>
|
|
<dd>No join operation is specified. If more than one file is specified for the FILE parameter, *NO is specified for the JDFTVAL parameter, and *ANY is specified for the JORDER parameter, the system automatically finds the join fields from the QRYSLT parameter.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 1: From field</b>
|
|
</p>
|
|
<p>Specify a field name to provide the value used to select records in a join secondary file, member, and record format. The field name may be qualified with either a file name or number that indicates which element in the list of files, members, and record formats, specified for the FILE parameter contains the field. The special value *MAPFLD can also be used to qualify the field name if the field is defined on the MAPFLD parameter.
|
|
</p>
|
|
<p>A join from-field is a simple field or a mapped field, defined on the MAPFLD parameter. If either *YES or *ONLYDFT is specified for the JDFTVAL parameter, a join from-field depends only on fields that are contained in the join primary or in join secondaries specified for the FILE parameter ahead of the join secondary associated with the to-field of the pair.
|
|
</p>
|
|
<dl>
|
|
<dt><b></b></dt>
|
|
<dd>
|
|
<p><b>Qualifier 1: From field</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the from-field.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><b></b></dt>
|
|
<dd>
|
|
<p><b>Qualifier 2: File or element</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>*MAPFLD</b></dt>
|
|
<dd>The field is defined on the MAPFLD parameter.
|
|
</dd>
|
|
<dt><b>1-32</b></dt>
|
|
<dd>Specify the position of the element list value for the FILE parameter to be used. The element list value identifies the database file, file member, and record format to be used.
|
|
</dd>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of a database file specified for the FILE parameter.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 2: To field</b>
|
|
</p>
|
|
<p>Specify a field name used to select records from a join secondary file, member, and record format in constructing the query records. The field name is qualified with either a file name or number that indicates which element in the list of files, members, and record formats specified in the FILE parameter contains the field. The special value *MAPFLD can also be used to qualify the field name if the field is defined on the MAPFLD parameter.
|
|
</p>
|
|
<p>A join to-field is a simple field or a mapped field, defined on the MAPFLD parameter. If either *YES or *ONLYDFT is specified for the JDFTVAL parameter, a join to-field depends only on fields that are contained all in a single join secondary. If the join secondary is a join logical file, only fields contained in the primary physical file member for the join logical file are used as components of the join to-field. The sum of the lengths of all to-fields for each join secondary (after change, if the from-field and to-field attributes are not identical) cannot be more than 2000 bytes unless JDFTVAL(*NO) is specified, where there is no 2000-byte limit.
|
|
</p>
|
|
<dl>
|
|
<dt><b></b></dt>
|
|
<dd>
|
|
<p><b>Qualifier 1: To field</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the to-field.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><b></b></dt>
|
|
<dd>
|
|
<p><b>Qualifier 2: File or element</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>*MAPFLD</b></dt>
|
|
<dd>The field is defined on the MAPFLD parameter.
|
|
</dd>
|
|
<dt><b>1-32</b></dt>
|
|
<dd>Specify the position of the element list value for the FILE parameter to be used. The element list value identifies the database file, file member, and record format to be used.
|
|
</dd>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of a database file specified for the FILE parameter.
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 3: Join operator</b>
|
|
</p>
|
|
<p>Specifies the type of join operation that is performed for the specified from-field and to-field. If *NO is specified for the JDFTVAL parameter and *ANY is specified for the JORDER parameter, or if more than one join field pair is specified, a different join operator may be specified for each pair. If *YES or *ONLYDFT is specified for the JDFTVAL parameter, or *FILE is specified for the JORDER parameter, then only one join operator may be specified regardless of the join pairs.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*EQ</u></b></dt>
|
|
<dd>An equal join operation is performed.
|
|
</dd>
|
|
<dt><b>*GT</b></dt>
|
|
<dd>A greater than join operation is performed.
|
|
</dd>
|
|
<dt><b>*LT</b></dt>
|
|
<dd>A less than join operation is performed.
|
|
</dd>
|
|
<dt><b>*NE</b></dt>
|
|
<dd>A not equal join operation is performed.
|
|
</dd>
|
|
<dt><b>*GE</b></dt>
|
|
<dd>A greater than or equal join operation is performed.
|
|
</dd>
|
|
<dt><b>*LE</b></dt>
|
|
<dd>A less than or equal join operation is performed.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.JDFTVAL"></a>
|
|
<h3>Join with default values (JDFTVAL)</h3>
|
|
<p>Specifies whether the query file should include join records that use default values for any of the fields from a join secondary file that does not contain a record with correct field values that satisfy the join connections specified on the <b>Join field specifications (JFLD)</b> parameter.
|
|
</p>
|
|
<p>Join processing attempts to collect field values from the join primary and join secondaries. It does so by matching join from-field values to records in a join secondary that produce the appropriate values in the join to-field. If there are no records in a join secondary to produce the to-field values required for the pairs of join fields associated with the join secondary, this parameter specifies whether query records should be constructed using default values for all fields obtained from the join secondary.
|
|
</p>
|
|
<p>If the <b>File specifications (FILE)</b> parameter includes any join logic files, all join logical files must be compatible with this parameter's value. If the data description specification (DDS) used to create a queried join logical file does not contain the JDFTVAL keyword, this parameter may not be used for any of the join logical files specified for the FILE parameter, and JDFTVAL(*NO) is required. If any join logical file has the JDFTVAL keyword specified for the FILE parameter, then join logical files for this open query file must be created using the JDFTVAL keyword, and *YES is required. If any files on the FILE parameter are view logical files, then *NO must be specified this parameter.
|
|
</p>
|
|
<p>If the JDFTVAL attribute is not compatible with the attributes of the join logical files processed, you can replace the join or view logical files specified for the FILE parameter with their based-on physical file members. You can provide the correct, additional from-field and to-field pairs on the JFLD parameter in order to join records from the physical file members in any way.
|
|
</p>
|
|
<p>If more than one file is specified for the FILE parameter, and either *YES or *ONLYDFT is specified, the system uses the join fields as specified for the JFLD parameter as the final join specification.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NO</u></b></dt>
|
|
<dd>No default values are used to construct join query records.
|
|
</dd>
|
|
<dt><b>*YES</b></dt>
|
|
<dd>Create all records for the join, including those produced both with and without using default values. No view logical files are allowed on the FILE parameter.
|
|
</dd>
|
|
<dt><b>*ONLYDFT</b></dt>
|
|
<dd>Create only the records produced by using default values in constructing the join. This option is used to include only exception records in the records available through the open query file. If *ONLYDFT is specified, no join or view logical files may be specified for the FILE parameter.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.JORDER"></a>
|
|
<h3>Join file order (JORDER)</h3>
|
|
<p>Specifies, for a join query, whether the join order must match the order specified for the <b>File specifications (FILE)</b> parameter. If the join order is varied, the query records are generated in a different arrangement. If the value specified for the <b>Join with default values (JDFTVAL)</b> parameter is *YES or *ONLYDFT, this parameter is ignored. The order specified for the FILE parameter is always preserved, because changing the join order can change which records are returned when join default value processing is required.
|
|
</p>
|
|
<p>If more than one file is specified in the FILE parameter and *FILE is specified, the system uses the join fields as specified for the <b>Join field specifications (JFLD)</b> parameter as the final join specifications.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*ANY</u></b></dt>
|
|
<dd>Any join file order is allowed, and any such arrangement may be used by the system to create the query records. It is possible for a query to return result records in a different arrangement if the same query is run twice consecutively (based on factors such as the current number of records in the files that are asked). *ANY allows the system more flexibility to improve the performance of processing records through the open query file than any other <b>Join file order (JORDER)</b> parameter value.
|
|
</dd>
|
|
<dt><b>*FILE</b></dt>
|
|
<dd>The order of the file, member, and record format elements specified for the FILE parameter are preserved in the join operation.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.GRPFLD"></a>
|
|
<h3>Grouping field names (GRPFLD)</h3>
|
|
<p>Specifies the field names that are used to group query results. One query record is created for each group of records (after join processing, if required) selected by the <b>Query selection expression (QRYSLT)</b> parameter. The group is defined by the collection of records that has the same set of values for the fields specified in the record format identified on the <b>Format specifications (FORMAT)</b> parameter. All null values within a group are considered equal. If no field names are specified and group processing is required, the whole file is considered to be one group. Each query record that is created is either made available through the open query file or is discarded, depending on the selection values specified for the <b>Group selection expression (GRPSLT)</b> parameter. To ensure a sequence, you must specify the <b>Key field specifications (KEYFLD)</b> parameter.
|
|
</p>
|
|
<p><b>Single values</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NONE</u></b></dt>
|
|
<dd>No fields are used to form groups. If the grouping function is required (because selection values are specified for the GRPSLT parameter, or an aggregate function is used by a field specified for the <b>Mapped field specifications (MAPFLD)</b> parameter), all records selected by the values specified for the QRYSLT parameter are handled as a single group.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Other values</b>
|
|
</p>
|
|
<p>Specify one or more field names (up to 50) to be used to group the query results. Each field name may be qualified with either a file name or number to indicate which element in the list of files, members, and record formats specified for the FILE parameter contains the field. The special value *MAPFLD may also be used to qualify the field name if the field is specified for the MAPFLD parameter.
|
|
</p>
|
|
<p>A grouping field defined on the MAPFLD parameter cannot refer to an aggregate function in its definition (either directly, or indirectly through the use of another field specified for the MAPFLD parameter). The sum of the lengths of all grouping fields cannot exceed 2000 bytes.
|
|
</p>
|
|
<p><b>Qualifier 1: Grouping field names</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of a field to be used to group query results.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Qualifier 2: File or element</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>*MAPFLD</b></dt>
|
|
<dd>The field is defined on the MAPFLD parameter.
|
|
</dd>
|
|
<dt><b>1-32</b></dt>
|
|
<dd>Specify the position of the element list value for the FILE parameter to be used. The element list value identifies the database file, file member, and record format to be used.
|
|
</dd>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of a database file specified for the FILE parameter.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.GRPSLT"></a>
|
|
<h3>Group selection expression (GRPSLT)</h3>
|
|
<p>Specifies the selection values used after grouping to determine which records are available through the open query file.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*ALL</u></b></dt>
|
|
<dd>All records defined by the grouping function described by the <b>Grouping field names (GRPFLD)</b> parameter are selected.
|
|
</dd>
|
|
<dt><b><i>'group-selection'</i></b></dt>
|
|
<dd>Specify an expression (contained in apostrophes) that describes the values used to determine which records are to be selected. Any logical expression formed from relationships (such as *EQ and *NE) of field and constant values, or functions of field and constant values, are specified. Only grouping fields (specified for the GRPFLD parameter), literals, aggregate functions (such as %AVG and %STDDEV), and mapped fields (specified for the <b>Mapped field specifications (MAPFLD)</b> parameter) that are composed of grouping fields, aggregate functions, and literals are referred to in any relationship. At least one field must be specified in each relationship.
|
|
<p>Each field name may be qualified with either a file name or number that indicates which element in the list of files, members, and record formats specified for the <b>File specifications (FILE)</b> parameter contains the field. The special value *MAPFLD may also be used to qualify the field name if the field is specified for the MAPFLD parameter.
|
|
</p>
|
|
<p>For more information on data type compatibility, see Database information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.MAPFLD"></a>
|
|
<h3>Mapped field specifications (MAPFLD)</h3>
|
|
<p>Specifies the definition of query fields that are mapped or derived from other fields. MAPFLD is generally not needed if the field names specified on other parameters are simple field names that exist in only one of the file, member, and record format elements specified for the <b>File specifications (FILE)</b> parameter.
|
|
</p>
|
|
<p>Up to 50 mapped field definitions can be specified.
|
|
</p>
|
|
<p><b>Single values</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NONE</u></b></dt>
|
|
<dd>No mapped fields are needed. All field names specified on other parameters exist in some record format specified for the FILE parameter.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 1: Mapped field</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the simple field name used on any other parameter that must refer to this mapped field. A qualified name is <b>not</b> allowed for the first part of the parameter list element. All specified mapped-field-name values must be unique.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 2: Field definition expression</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>character-value</i></b></dt>
|
|
<dd>Specify an expression of up to 256 characters (contained in apostrophes) which defines the mapped field in terms of other fields that either exist in one of the file, member, and record format elements specified for the FILE parameter, or are defined by some other mapped field definition appearing earlier in the list. Either numeric operations or string operations are allowed, depending on the data type of the fields used in the definition.
|
|
<p>Each field name may be qualified with either a file name or number that indicates which element in the list of files, members, and record formats specified for the FILE parameter contains the field. The special value *MAPFLD may also be used to qualify the field name if the field is specified for the <b>Mapped field specifications (MAPFLD)</b> parameter.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 3: Mapped field type</b>
|
|
</p>
|
|
<p>Specify the field type for this mapped field, or specify *CALC to allow the system to calculate appropriate attributes (including field type) for the mapped field. *CALC is the default if no field-type value is specified.
|
|
</p>
|
|
<p>When *CALC is used, the field attributes are determined in one of two ways. The attributes either match the field definition in the record format identified on the <b>Format specifications (FORMAT)</b> parameter, or (if the field is not in the record format on the FORMAT parameter) the attributes are calculated based on the expression specified in the mapped-field-definition for this field. If the mapped field is used in the record format identified on the FORMAT parameter, you must either use *CALC or specify attributes (field-type, field-length, and field-decimals) identical to those of the field in the record format specified for the FORMAT parameter.
|
|
</p>
|
|
<p>The field type must be valid for the final result of the expression specified for the mapped-field-definition.
|
|
</p>
|
|
<p>The following are the mappings that are not supported between character, DBCS-open, DBCS-either, DBCS-only, graphic, binary string, and numeric types:
|
|
</p>
|
|
<ul>
|
|
<li>From character or numeric to DBCS-only
|
|
</li>
|
|
<li>From DBCS-open to DBCS-either or DBCS-only
|
|
</li>
|
|
<li>From DBCS-either to character, numeric, or DBCS-only
|
|
</li>
|
|
<li>From DBCS-only or DBCS-graphic to character or numeric
|
|
</li>
|
|
<li>From UCS-2 or UTF-16 to DBCS-either or DBCS-only
|
|
</li>
|
|
<li>From binary string to any non-binary string
|
|
</li>
|
|
<li>From numeric to binary string
|
|
</li>
|
|
</ul>
|
|
<p>
|
|
<b>Note: </b>Binary string refers to both BLOB and BINCHAR data types.
|
|
</p>
|
|
<p>For more information on mappings see Database information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*CALC</u></b></dt>
|
|
<dd>Calculate appropriate field type attributes.
|
|
</dd>
|
|
<dt><b>*BIN2</b></dt>
|
|
<dd>Two-byte binary field.
|
|
</dd>
|
|
<dt><b>*BIN4</b></dt>
|
|
<dd>Four-byte binary field.
|
|
</dd>
|
|
<dt><b>*FLT4</b></dt>
|
|
<dd>Four-byte floating-point field.
|
|
</dd>
|
|
<dt><b>*FLT8</b></dt>
|
|
<dd>Eight-byte floating-point field.
|
|
</dd>
|
|
<dt><b>*DEC</b></dt>
|
|
<dd>Packed decimal field.
|
|
</dd>
|
|
<dt><b>*ZONED</b></dt>
|
|
<dd>Zoned decimal field.
|
|
</dd>
|
|
<dt><b>*CHAR</b></dt>
|
|
<dd>Character field.
|
|
</dd>
|
|
<dt><b>*VCHAR</b></dt>
|
|
<dd>Variable length character field.
|
|
</dd>
|
|
<dt><b>*HEX</b></dt>
|
|
<dd>Hexadecimal field.
|
|
</dd>
|
|
<dt><b>*VHEX</b></dt>
|
|
<dd>Variable length hexadecimal field.
|
|
</dd>
|
|
<dt><b>*DATE</b></dt>
|
|
<dd>Date field.
|
|
</dd>
|
|
<dt><b>*TIME</b></dt>
|
|
<dd>Time field.
|
|
</dd>
|
|
<dt><b>*TIMESTP</b></dt>
|
|
<dd>Timestamp field.
|
|
</dd>
|
|
<dt><b>*ONLY</b></dt>
|
|
<dd>DBCS-only field.
|
|
</dd>
|
|
<dt><b>*VONLY</b></dt>
|
|
<dd>Variable length DBCS-only field.
|
|
</dd>
|
|
<dt><b>*OPEN</b></dt>
|
|
<dd>DBCS-open field.
|
|
</dd>
|
|
<dt><b>*VOPEN</b></dt>
|
|
<dd>Variable length DBCS-open field.
|
|
</dd>
|
|
<dt><b>*EITHER</b></dt>
|
|
<dd>DBCS-either field.
|
|
</dd>
|
|
<dt><b>*VEITHER</b></dt>
|
|
<dd>Variable length DBCS-either field.
|
|
</dd>
|
|
<dt><b>*GRAPHIC</b></dt>
|
|
<dd>DBCS-graphic field.
|
|
</dd>
|
|
<dt><b>*VGRAPHIC</b></dt>
|
|
<dd>Variable length DBCS-graphic field.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 4: Length</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>0-32766</i></b></dt>
|
|
<dd>Specify the field length in number of digits for a numeric field, number of bytes for a character or DBCS field, or number of characters for a graphic field. A field length must be an even value for DBCS-only and DBCS-either field types. The range of valid lengths for each field type is shown Table 1. A value must not be specified if *CALC is used for the element 3 (Mapped field type).
|
|
</dd>
|
|
</dl>
|
|
<table border="1">
|
|
<caption align="bottom"><b>Figure: Table 1. Query Field Structure</b>
|
|
</caption>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
<pre>
|
|
+------------------+----------------+------------------+
|
|
| Field Type | External | Default Length |
|
|
| | Field Length | and Decimals |
|
|
+------------------+----------------+------------------+
|
|
| *BIN2 | 1-5 | 5 0 |
|
|
| *BIN4 | 1-10 | 10 0 |
|
|
| *FLT4 | 1-9 | 7 6 |
|
|
| *FLT8 | 1-17 | 15 14 |
|
|
| *DEC | 1-63 | 15 5 |
|
|
| *ZONED | 1-63 | 15 5 |
|
|
| *CHAR | 1-32766 | 32 |
|
|
| *VCHAR | 0-32740 | 32 |
|
|
| *HEX | 1-32766 | 32 |
|
|
| *VHEX | 0-32740 | 32 |
|
|
| *DATE | 5-10 | 8 |
|
|
| *TIME | 4-8 | 7 |
|
|
| *TIMESTP | 14; 16-26 | 26 |
|
|
| *ONLY | 4-32766 | 32 |
|
|
| *VONLY | 0-32740 | 32 |
|
|
| *OPEN | 4-32766 | 32 |
|
|
| *VOPEN | 0-32740 | 32 |
|
|
| *EITHER | 4-32766 | 32 |
|
|
| *VEITHER | 0-32740 | 32 |
|
|
| *GRAPHIC | 1-16383 | 32 |
|
|
| *VGRAPHIC | 0-16370 | 32 |
|
|
+------------------+----------------+------------------+
|
|
</pre>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<p><b>Element 5: Decimal positions</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>0-63</i></b></dt>
|
|
<dd>Specify the number of decimal positions for a numeric field, expressed as a number of decimal digits, that is no larger than the total number of digits specified for the field length. If no value is given, the value is assumed to be zero. A value must not be specified for a binary or character field, or if *CALC is specified for element 3 (Mapped field type).
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 6: Mapped field CCSID</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*CALC</u></b></dt>
|
|
<dd>The coded character set identifier (CCSID) value is determined by the CCSIDs of the fields or literal values that make up the MAPFLD field definition.
|
|
</dd>
|
|
<dt><b>*HEX</b></dt>
|
|
<dd>A pre-defined value is used such that no translation of the field data takes place.
|
|
</dd>
|
|
<dt><b><i>1-65535</i></b></dt>
|
|
<dd>Specify the CCSID to be used. To see a complete list of identifiers when prompting this command, position the cursor on the field for this parameter and press F4 (Prompt).
|
|
<p>Literal values in the MAPFLD definition are tagged with the job default CCSID. However, if the MAPFLD consists of only a literal value and the user specifies a field-CCSID value, the literal value will be tagged with that CCSID. This allows you to tag a literal with a CCSID other than the job's default CCSID.
|
|
</p>
|
|
<p>
|
|
<b>Note: </b>Normally, *HEX and *VHEX fields do not have an associated CCSID. Because of this, the data in the field is treated the same regardless of the default CCSID of the system on which the data is being used. However, if you specify a CCSID for a *HEX or *VHEX field, the CCSID overrides the hexadecimal attribute of the field (causing the field to be treated as *CHAR or *VCHAR), and the data in the field may be treated differently if it is moved to a system that has a different default CCSID.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.IGNDECERR"></a>
|
|
<h3>Ignore decimal data errors (IGNDECERR)</h3>
|
|
<p>Specifies whether the system ignores decimal data errors during query processing.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NO</u></b></dt>
|
|
<dd>The system does not ignore decimal data errors.
|
|
</dd>
|
|
<dt><b>*YES</b></dt>
|
|
<dd>The system ignores decimal data errors. When errors in decimal data are encountered, the not valid sign or digits are automatically changed to valid values.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.OPNID"></a>
|
|
<h3>Open file identifier (OPNID)</h3>
|
|
<p>Specifies the identifier used to name the open query file so that it is referred to on the Close File (CLOF) or Position Database File (POSDBF) command when it is closed. The identifier must differ from the identifier associated with any other file previously opened with the Open Database File (OPNDBF) command or OPNQRYF command, and which is not yet closed.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*FILE</u></b></dt>
|
|
<dd>The name of the first or only file specified for the <b>File specifications (FILE)</b> parameter is used for the open identifier.
|
|
</dd>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name you want to associate with this open query file.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.SEQONLY"></a>
|
|
<h3>Limit to sequential only (SEQONLY)</h3>
|
|
<p>Specifies whether sequential-only processing is used for the file, and specifies the number of records processed as a group when read or write operations are performed to the open query file. The open query file ODP uses a different SEQONLY value than the one specified on this parameter, depending on other parameter values specified on this command. A message is sent if the SEQONLY value is changed.
|
|
</p>
|
|
<p><b>Single values</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>*NO</b></dt>
|
|
<dd>The file does not use sequential-only processing.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 1: Sequential only</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*YES</u></b></dt>
|
|
<dd>The open query file uses sequential-only processing.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 2: Number of records</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>1-32767</i></b></dt>
|
|
<dd>Specify the number of records that are processed as a group when read or write operations are performed to the open query file. If no value is specified, the system calculates the number of records to be processed as a group.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.COMMIT"></a>
|
|
<h3>Commitment control active (COMMIT)</h3>
|
|
<p>Specifies whether this file is placed under commitment control.
|
|
</p>
|
|
<p>Before a database file is opened under commitment control, the user must ensure that all files in the commitment transaction are journaled. If only the after images are being journaled, the system implicitly begins journaling both the before and the after images for the duration of the changes being made to files opened under this commitment definition.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NO</u></b></dt>
|
|
<dd>The open query file is not placed under commitment control.
|
|
</dd>
|
|
<dt><b>*YES</b></dt>
|
|
<dd>The open query file is placed under commitment control.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.OPNSCOPE"></a>
|
|
<h3>Open scope (OPNSCOPE)</h3>
|
|
<p>Specifies the extent of influence (scope) of the open operation.
|
|
</p>
|
|
<p>
|
|
<b>Note: </b>This parameter is not valid when TYPE is also specified.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*ACTGRPDFN</u></b></dt>
|
|
<dd>The scope of the open operation is determined by the activation group of the program that called the OPNQRYF command processing program. If the activation group is the default activation group, the scope is the call level of the caller. If the activation group is a non-default activation group, the scope is the activation group of the caller. In a multithreaded job, only those opens within the same thread and within the same activation group can share this ODP.
|
|
</dd>
|
|
<dt><b>*ACTGRP</b></dt>
|
|
<dd>The scope of the open data path (ODP) is the activation group. Only those shared opens from the same activation group can share this ODP. This ODP is not reclaimed until the activation group is deactivated, or until the Close File (CLOF) command closes the activation group.
|
|
</dd>
|
|
<dt><b>*JOB</b></dt>
|
|
<dd>The scope of the open operation is the job in which the open operation occurs. If the job is multi-threaded, only those opens from the same thread can share this ODP.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.DUPKEYCHK"></a>
|
|
<h3>Duplicate key check (DUPKEYCHK)</h3>
|
|
<p>Specifies whether duplicate key checking should be done on input and output operations for the file opened by this command.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NO</u></b></dt>
|
|
<dd>No duplicate key feedback is provided on input and output commands.
|
|
</dd>
|
|
<dt><b>*YES</b></dt>
|
|
<dd>Duplicate key feedback is provided on input and output commands.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.ALWCPYDTA"></a>
|
|
<h3>Allow copy of data (ALWCPYDTA)</h3>
|
|
<p>Specifies whether the system is allowed to copy data from the files, members, and record formats specified for the <b>File specifications (FILE)</b> parameter. If so, the system is allowed to open the query file to the copy. The system generally tries to avoid using a copy of the data because the copy does not reflect changes made to the database after the information is copied. However, certain requests require that the data be copied in order to perform the specified query functions (such as when key fields contained in multiple based-on files for a join are specified).
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*YES</u></b></dt>
|
|
<dd>The system may use a copy of data from the files, members, and record formats specified for the <b>File specifications (FILE)</b> parameter. A copy of the data is used only when it is needed to perform the requested query functions.
|
|
</dd>
|
|
<dt><b>*OPTIMIZE</b></dt>
|
|
<dd>The system uses a sort routine to order the output from the files, file members, and record formats specified for theFILE parameter. A sort routine is used only if the KEYFLD parameter is specified, and if using a sort routine would improve query performance without conflicting with other OPNQRYF options.
|
|
<p>A sort will improve the performance of a query that returns most or all of the records in the file or files specified for theFILE parameter.
|
|
</p>
|
|
<p>Using a sort can increase the time required for the OPNQRYF command to process. This occurs because the sort is performed and all records to be returned through the query are processed while the OPNQRYF command is active. However, because the records are already processed, the reading of the records (by using either a program or the CPYFRMQRYF command) is very fast. Therefore, the overall time to process the query is reduced.
|
|
</p>
|
|
<p>Specifying the KEYFLD parameter for the OPNQRYF command does not ensure that the query will use an index if ALWCPYDTA(*OPTIMIZE) is specified. If a sort routine is used, the file is not opened with indexed access. If the program reading the records from the OPNQRYF command requires indexed access (random processing rather than sequential processing), ALWCPYDTA(*YES) or ALWCPYDTA(*NO) should be specified.
|
|
</p>
|
|
<p>When a sort is used, the query file's position is not changed when a ROLLBACK statement is issued. Therefore, when a query is opened that has parameters, ROLLBACK statements that follow do not reset the queried file's position to where it was at the start of the unit of recovery.
|
|
</p>
|
|
<p>
|
|
<b>Note: </b>Do not specify ALWCPYDTA(*OPTIMIZE) if you require that a ROLLBACK statement reposition the query file, or if you require that the queried file be opened with indexed access.
|
|
</p>
|
|
<p>The following items are required before a sort is valid for the OPNQRYF command:
|
|
</p>
|
|
<ul>
|
|
<li>ALWCPYDTA(*OPTIMIZE) must be specified.
|
|
</li>
|
|
<li>The OPTION parameter, if specified, must be *INP.
|
|
</li>
|
|
<li>A value other than *FILE or *NONE must be specified on the KEYFLD parameter.
|
|
</li>
|
|
<li>The UNIQUEKEY parameter must not be specified, or must specify *NONE.
|
|
</li>
|
|
<li>The SEQONLY parameter, if specified, must be *YES.
|
|
</li>
|
|
<li>The DUPKEYCHK parameter must not be specified, or must specify *NO.
|
|
</li>
|
|
<li>The total buffer length of all fields in the file specified for the FORMAT parameter (or FILE parameter, if the FORMAT parameter is not specified) must not exceed 32700 bytes.
|
|
</li>
|
|
</ul>
|
|
<p>The query optimizer determines whether a sort is used. This decision is based on the number of records expected from the query and the options specified for the OPNQRYF statement. The following items influence the optimizer's choice of a sort:
|
|
</p>
|
|
<ul>
|
|
<li>The OPTIMIZE parameter should specify *ALLIO or *MINWAIT. If *FIRSTIO is specified, the number of records specified should be close or equal to the number of result records expected from the query.
|
|
</li>
|
|
<li>The number of records in a file specified for theFILE parameter should contain a minimum of 200 records.
|
|
</li>
|
|
<li>The query result should contain a minimum of 200 records.
|
|
</li>
|
|
</ul>
|
|
</dd>
|
|
<dt><b>*NO</b></dt>
|
|
<dd>The system does not use a copy of data from the files, members, and record formats specified for the <b>File specifications (FILE)</b> parameter. If it is necessary to use a copy of the data to perform the requested query functions, the query file is not opened and an error message is issued.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.OPTIMIZE"></a>
|
|
<h3>Performance optimization (OPTIMIZE)</h3>
|
|
<p>Specifies what optimization goal is used by the system in deciding how to perform the selection and join processing necessary to satisfy other specifications on this command.
|
|
</p>
|
|
<p>If the <b>Key field specifications (KEYFLD)</b> parameter or <b>Grouping field names (GRPFLD)</b> parameter require that an access path be built (when no existing access path can be shared), the access path is built completely, regardless of the value specified for this parameter. Optimization primarily affects the timing of selection processing.
|
|
</p>
|
|
<p><b>Single values</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*ALLIO</u></b></dt>
|
|
<dd>The system attempts to improve the total time to process the whole query, assuming that all query records are read from the file.
|
|
</dd>
|
|
<dt><b>*MINWAIT</b></dt>
|
|
<dd>The system attempts to improve the query to minimize delays when reading records from the file.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 1: Performance optimization</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*FIRSTIO</u></b></dt>
|
|
<dd>The system attempts to improve the time to open the query file and retrieve the first buffer of records from the file.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Element 2: Number of records</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>1-2147483647</i></b></dt>
|
|
<dd>Specify the number of records expected to be retrieved. The query optimizer will use this information to determine the proper implementation for the query.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.OPTALLAP"></a>
|
|
<h3>Optimize all access paths (OPTALLAP)</h3>
|
|
<p>Specifies whether the query optimizer should consider all the access paths that exist over the files being queried when determining how to accomplish the query.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NO</u></b></dt>
|
|
<dd>Allow the query optimizer to operate normally. When determining how to start a query, the optimizer considers access paths until an internal timeout value has been exceeded. If there are a large number of access paths over the files being queried, the optimizer may time out before it has considered all the available access paths.
|
|
</dd>
|
|
<dt><b>*YES</b></dt>
|
|
<dd>Force the query optimizer to ignore the internal timeout value and consider all the available access paths over all the files in the query. Note that if there are a large number of access paths over the files it may take a long time to optimize the query.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.SRTSEQ"></a>
|
|
<h3>Sort sequence (SRTSEQ)</h3>
|
|
<p>Specifies the sort sequence to be used for sorting and grouping selections specified for the QRYSLT or GRPSLT parameters, joins specified for the JFLD parameter, ordering specified for the KEYFLD parameter, grouping specified for the GRPFLD parameter, %MIN or %MAX built in functions, or unique key values specified for the UNIQUEKEY parameter.
|
|
</p>
|
|
<p><b>Single values</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*JOB</u></b></dt>
|
|
<dd>The SRTSEQ value for the job is retrieved for the job.
|
|
</dd>
|
|
<dt><b>*HEX</b></dt>
|
|
<dd>A sort sequence table is not used, and the hexadecimal values of the characters are used to determine the sort sequence.
|
|
</dd>
|
|
<dt><b>*LANGIDSHR</b></dt>
|
|
<dd>A shared weight sort table is used.
|
|
</dd>
|
|
<dt><b>*LANGIDUNQ</b></dt>
|
|
<dd>A unique weight sort table is used.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Qualifier 1: Sort sequence</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the sort sequence table to be used with this query.
|
|
</dd>
|
|
</dl>
|
|
<p><b>Qualifier 2: Library</b>
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*LIBL</u></b></dt>
|
|
<dd>All libraries in the user and system portions of the job's library list are searched.
|
|
</dd>
|
|
<dt><b>*CURLIB</b></dt>
|
|
<dd>The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
|
|
</dd>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the library to be searched.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.LANGID"></a>
|
|
<h3>Language ID (LANGID)</h3>
|
|
<p>Specifies the language identifier to be used when SRTSEQ(*LANGIDUNQ) or SRTSEQ(*LANGIDSHR) is specified.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*JOB</u></b></dt>
|
|
<dd>The LANGID value for the job is retrieved for the job.
|
|
</dd>
|
|
<dt><b><i>language-ID</i></b></dt>
|
|
<dd>Specify the language identifier to be used by the job.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.CCSID"></a>
|
|
<h3>Final output CCSID (CCSID)</h3>
|
|
<p>Specifies the coded character set identifier (CCSID) in which data from character, DBCS-open, DBCS-either and graphic fields will be returned. Data from UTF-8, UCS-2, or UTF-16 fields will not be converted.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*JOB</u></b></dt>
|
|
<dd>Data is returned in the CCSID of the job issuing the OPNQRYF command.
|
|
</dd>
|
|
<dt><b>*HEX</b></dt>
|
|
<dd>No CCSID conversion is performed before the data is returned.
|
|
</dd>
|
|
<dt><b><i>1-65535</i></b></dt>
|
|
<dd>Specify a CCSID value. Data will be converted to this CCSID before it is returned.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="OPNQRYF.TYPE"></a>
|
|
<h3>Type of open (TYPE)</h3>
|
|
<p>Specifies the level at which the Reclaim Resources (RCLRSC) command closes the file.
|
|
</p>
|
|
<p>
|
|
<b>Note: </b>This parameter is ignored unless the default value is specified on the OPNSCOPE parameter and the request is from the default activation group.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NORMAL</u></b></dt>
|
|
<dd>The Reclaim Resources (RCLRSC) command closes the file if the program call that ran this command is ended without closing the file.
|
|
</dd>
|
|
<dt><b>*PERM</b></dt>
|
|
<dd>The file remains open until the Close File (CLOF) command closes it, or until the routing step or default activation group ends. The query file remains open even if the Reclaim Resources (RCLRSC) command is run.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<hr size="2" width="100%">
|
|
<div><h3><a name="OPNQRYF.COMMAND.EXAMPLES">Examples</a> </h3>
|
|
<p><b>Example 1: Selecting Specific Records</b>
|
|
</p>
|
|
<p><b>Note:</b> Additional examples of selecting records using the OPNQRYF command can be found in the Database Programming topic in the Information Center.
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE(ordfile) OPTION(*ALL)
|
|
QRYSLT('orddate=%range("840101" "841231") &
|
|
ordamt>100')
|
|
KEYFLD((ordamt *descend))
|
|
</pre>
|
|
</p>
|
|
<p>This command uses the QRYSLT parameter to select only records in the first member of file ORDFILE that have an order date in 1984 and an order amount greater than 100. Because the FORMAT parameter is omitted, the open query file has the same record format as file ORDFILE. The open query file allows all file operations (input, output, update, and delete). The KEYFLD specification is used to force the records to be arranged by descending value of order amount.
|
|
</p>
|
|
<p><b>Example 2: Using the %XLATE Built-In Function</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE(telefile)
|
|
QRYSLT('%xlate(usrname qsystrntbl) *ct
|
|
"GEORGE"')
|
|
</pre>
|
|
</p>
|
|
<p>This command uses the %XLATE built-in function to translate the field USRNAME to uppercase, and to instruct the *CT operator to select only records that contain the value GEORGE in the field USRNAME. QSYSTRNTBL is an IBM-supplied system translation table that converts lowercase alphabetics (a through z) to uppercase (A through Z). The translation is done to ensure that the search value is recognized even if its characters appear in mixed case. The records available through the open query file have the same record format as those in file TELEFILE.
|
|
</p>
|
|
<p><b>Example 3: Using the %XLATE Built-In Function</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE(telefile) QRYSLT('usrname *ct ''GEORGE''')
|
|
MAPFLD((usrname
|
|
'%xlate(telefile/usrname qsystrntbl)'))
|
|
</pre>
|
|
</p>
|
|
<p>In the previous example, the value of field USRNAME, which is returned to the high-level language (HLL) program that reads records from the open query file, is not translated to uppercase.
|
|
</p>
|
|
<p>This example shows a way to make the uppercase version of field USRNAME available to the HLL program. This is done by defining a mapped field (MAPFLD parameter) for the translated value of field USRNAME. The field has the same field name as the field name in the open query file record format being used. The translated version of the field is used for selection (QRYSLT parameter) and is used in the open query file record format.
|
|
</p>
|
|
<p><b>Example 4: Using the %SST Built-In Function</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE((histlib/ordfile hist1))
|
|
OPTION(*inp *upd *dlt)
|
|
FORMAT(ordinfo orddtls) QRYSLT('month=7')
|
|
MAPFLD((year '%sst(orddate 1 2)' *zoned 2)
|
|
(month '%sst(orddate 3 2)' *zoned 2)
|
|
(day '%sst(orddate 5 2)' *zoned 2))
|
|
</pre>
|
|
</p>
|
|
<p>This command uses the %SST built-in function to create a substring of the year, month, and day parts of character field ORDDATE in file ORDFILE. If the file ORDINFO has a record format, ORDDTLS, containing at least the field's YEAR, MONTH, and DAY records, these fields have input-only usage in the open query file record format because they are defined by using a built-in function (%SST) and are mappings that mix character and numeric (zoned decimal format) types. The file is opened for input, update, and delete operations, but none of the field's YEAR, MONTH, and DAY records are updated using the open query file open data path (ODP). The open query file uses only records in the HIST1 member of file ORDFILE in library HISTLIB, and the records retrieved through the file have the same format as record format ORDDTLS in file ORDINFO. Only records pertaining to the month of July are processed through the open query file (QRYSLT parameter).
|
|
</p>
|
|
<p><b>Example 5: Returning the First Record of Each Set</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE((routelf *first locusr))
|
|
QRYSLT('%sst(toloc 1 4) *eq "ROCH"')
|
|
KEYFLD(fromusr fromloc tousr toloc) UNIQUEKEY(*all)
|
|
</pre>
|
|
</p>
|
|
<p>This command uses the KEYFLD and UNIQUEKEY parameters to return only the first record of each set of records in record format LOCUSR in the first member of file ROUTELF that have the same values for the fields FROMUSR, FROMLOC, TOUSR, and TOLOC. The query result is further restricted by selecting only records that have the value ROCH in the first four characters of field TOLOC. The records available through the open query file contain all of the fields in record format LOCUSR of file ROUTELF. If the file ROUTELF contains information about messages routed by an application, this example identifies all unique sender and receiver pairs in which the receiving location name begins with ROCH.
|
|
</p>
|
|
<p><b>Example 6: Joining a File to Itself</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE(partpf partpf) FORMAT(partjoin)
|
|
JFLD((1/pnbr 2/pnbr *GE))
|
|
MAPFLD((pnm1 '1/pname')
|
|
(pnm2 '2/pname')
|
|
(pnbr '1/pnbr'))
|
|
</pre>
|
|
</p>
|
|
<p>This example illustrates how a file is joined to itself, as well as how to use the MAPFLD parameter to rename fields in the based-on files. A greater than or join is performed using field PNBR as both the join from-field and the join to-field.
|
|
</p>
|
|
<p>The format of file PARTJOIN is assumed to contain fields named PNBR, PNM1, and PNM2. The field name PNBR is valid in the query output record format because that field is defined on the MAPFLD parameter. If the record format in file PARTJOIN contains a field named PNAME, an error occurs because the field exists in both files specified on the FILE parameter, and is not the name of a field defined on the MAPFLD parameter. The mapped field definitions are field names, so the attributes of fields PNM1 and PNM2 match the attributes of field PNAME, and the attributes of field PNBR in the open query file records match field PNBR in file PARTPF. Further, when a file is joined to itself, it is always necessary to specify a file number name for any field that is defined in the based-on file.
|
|
</p>
|
|
<p><b>Example 7: Renaming Fields in Based-On Files</b>
|
|
</p>
|
|
<p>The same query can also be specified as follows:
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE(partpf partpf) FORMAT(partjoin)
|
|
QRYSLT('1/pnbr *GE 2/pnbr')
|
|
MAPFLD((pnm1 '1/pname')
|
|
(pnm2 '2/pname')
|
|
(pnbr '1/pnbr'))
|
|
</pre>
|
|
</p>
|
|
<p>Because more than one file is specified on the FILE parameter, and the default value is specified for the JDFTVAL and JORDER parameters, the system takes the join specifications from the values specified on the QRYSLT parameter.
|
|
</p>
|
|
<p><b>Example 8: Selecting Master Records With No Detail Records</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE(cusmas ordfil) FORMAT(cusmas)
|
|
JFLD((cusnbr ordfil/cusnbr)) JDFTVAL(*onlydft)
|
|
MAPFLD((cusnbr 'cusmas/cusnbr'))
|
|
</pre>
|
|
</p>
|
|
<p>This command uses a join query to select only master records that have no associated detail records. The master file (CUSMAS) is joined (equal join) to the detail file (ORDFIL) by the customer number field that appears in both record formats. The customer number field name is the same in both record formats (CUSNBR). Because CUSNBR is the name of a field defined on the MAPFLD parameter, everywhere the simple field name CUSNBR is used, the mapped field version of the CUSNBR field in file CUSMAS is used (including the open query file record format, which matches the customer master file record format). The JDFTVAL parameter indicates that only records that are produced by using default values are available through the open query file. Every master record that has associated detail records (with the same value of the customer number field) is excluded, and every master record that has no associated detail records creates a result record.
|
|
</p>
|
|
<p><b>Example 9: Identifying Detail Records With No Associated Master Record</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE(ordfil cusmas) FORMAT(ordfil)
|
|
JFLD((cusnbr cusmas/cusnbr)) JDFTVAL(*onlydft)
|
|
MAPFLD((cusnbr 'ordfil/cusnbr'))
|
|
</pre>
|
|
</p>
|
|
<p>This change of the previous example (using the same files) shows how to identify all detail records with no associated master record (in this case, all orders with an unregistered customer number):
|
|
</p>
|
|
<p><b>Example 10: Calculating Basic Statistics</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE(scores) FORMAT(clsstats) GRPFLD(clsid)
|
|
GRPSLT('clsavg<70 & clsmax-clsmin>30')
|
|
MAPFLD((clscnt '%count')
|
|
(clsavg '%avg(usrscore)')
|
|
(clsmin '%min(usrscore)')
|
|
(clsmax '%max(usrscore)'))
|
|
</pre>
|
|
</p>
|
|
<p>This command uses the grouping function to calculate basic statistics for each group of records in file SCORES that have the same value in the field CLSID. Assuming file CLSSTATS has a record format containing field CLSID and all fields specified on the MAPFLD parameter, each record available through the open query file contains the value of the grouping field (CLSID) as well as the number of records included in the group and the average, minimum, and maximum values of field USRSCORE in the group. Selection occurs after grouping, so that records are created for groups only when the average value of USRSCORE in the group is less than 70 and the difference between the maximum and minimum scores in the group is greater than 30.
|
|
</p>
|
|
<p><b>Example 11: Selecting Records With a Specific Value</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE(ITMMAST)
|
|
QRYSLT('itmcode=%range(32 50) & itmtype="P"')
|
|
ALWCPYDTA(*NO) OPTIMIZE(*FIRSTIO)
|
|
SEQONLY(*YES 10) TYPE(*PERM)
|
|
</pre>
|
|
</p>
|
|
<p>This command selects from the first member of file ITMMAST only the records that have a value of field ITMCODE in the range from 32 through 50 and also have a value of field ITMTYPE equal to the letter P. The ALWCPYDTA parameter specifies that the open query file must never use a copy of the records in file ITMMAST. The OPTIMIZE and SEQONLY parameter values cause the system to attempt to improve processing for the open query file to minimize the time needed to retrieve the first buffer of ten records. This combination of parameter values is a good choice if the file is used with a high-level language interactive inquiry program that shares the open query file open data path (ODP) and shows ten records on each display screen. The open data path (ODP) for the open query file is 'permanent' (TYPE parameter), which means that it remains open either until the file is closed by using the Close File (CLOF) command or until the routing step ends.
|
|
</p>
|
|
<p><b>Example 12: Tagging a Literal with a Specific CCSID</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE(itmmast) QRYSLT('itmtype=pfield')
|
|
MAPFLD((pfield 'P' *CHAR 1 *N 930))
|
|
</pre>
|
|
</p>
|
|
<p>This command selects from the first member of file ITMMAST only the records that have a value of field ITMTYPE equal to the letter 'P' in character set 930. The mapped field is created so that the literal 'P' can be tagged with a specific CCSID.
|
|
</p>
|
|
<p>If a literal is not tagged with a specific CCSID, it is assigned the CCSID of the job running the query. Because of this, if an OPNQRYF statement is part of a CL program that is shared among systems with differing CCSIDs (in different countries, perhaps), a query that uses a literal in the selection specifications may not return the same results on all systems, even though the data in the files is the same. This happens because the internal representation of the literal may be different when the CL program is run in a job with a different CCSID. This representation then may not match the same records in the file. Note that the internal representation of the data in the file does not change based on the CCSID of the current job.
|
|
</p>
|
|
<p>Tagging the literal with a specific CCSID avoids this problem. A literal tagged with a specific CCSID keeps the same internal representation on all systems. The CCSID that is used to tag the literal should be the same as the CCSID assigned to the field against which the literal is being compared.
|
|
</p>
|
|
<p><b>Example 13: Using a Nonjoin Query</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE((EMPLOYEE)) KEYFLD((NAME))
|
|
ALWCPYDTA(*OPTIMIZE)
|
|
</pre>
|
|
</p>
|
|
<p>This command returns all of the records in the EMPLOYEE file.
|
|
</p>
|
|
<p><b>Example 14: Using a Join Query</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE((EMPLOYEE) (MANAGEMENT)) FORMAT(EMPLOYEE)
|
|
KEYFLD((NAME)) JFLD((1/EMPID 2/MEMPID))
|
|
ALWCPYDTA(*OPTIMIZE)
|
|
</pre>
|
|
</p>
|
|
<p>This command returns all of the records required by the join criteria.
|
|
</p>
|
|
<p><b>Example 15: Query Comparing Character and Numeric Data</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
OPNQRYF FILE((STAFF)) QRYSLT('SALARY > "18357.50"')
|
|
</pre>
|
|
</p>
|
|
<p>This command returns all of the records in the STAFF file where their salary is greater than 18357.50 even though SALARY is a numeric field and the literal value in the QRYSLT is character.
|
|
</p>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<hr size="2" width="100%">
|
|
<div><h3><a name="OPNQRYF.ERROR.MESSAGES">Error messages</a> </h3>
|
|
<p><b><u>*ESCAPE Messages</u></b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>CPF2115</b></dt>
|
|
<dd>Object &1 in &2 type *&3 damaged.
|
|
</dd>
|
|
<dt><b>CPF2169</b></dt>
|
|
<dd>Job's sort sequence information not available.
|
|
</dd>
|
|
<dt><b>CPF2619</b></dt>
|
|
<dd>Table &1 not found.
|
|
</dd>
|
|
<dt><b>CPF3BCC</b></dt>
|
|
<dd>Language identifier &1 not valid.
|
|
</dd>
|
|
<dt><b>CPF3BC6</b></dt>
|
|
<dd>Sort sequence &1 not valid.
|
|
</dd>
|
|
<dt><b>CPF3BC7</b></dt>
|
|
<dd>CCSID &1 outside of valid range.
|
|
</dd>
|
|
<dt><b>CPF3BC8</b></dt>
|
|
<dd>Conversion from CCSID &1 to CCSID &2 is not supported.
|
|
</dd>
|
|
<dt><b>CPF3BC9</b></dt>
|
|
<dd>Conversion from CCSID &1 to CCSID &2 is not defined.
|
|
</dd>
|
|
<dt><b>CPF3BDD</b></dt>
|
|
<dd>Sort sequence &1 not valid for UCS2 data.
|
|
</dd>
|
|
<dt><b>CPF3FC0</b></dt>
|
|
<dd>Language identifier is not valid.
|
|
</dd>
|
|
<dt><b>CPF4174</b></dt>
|
|
<dd>OPNID(&4) for file &1 already exists.
|
|
</dd>
|
|
<dt><b>CPF8133</b></dt>
|
|
<dd>Table &4 in &9 damaged.
|
|
</dd>
|
|
<dt><b>CPF9801</b></dt>
|
|
<dd>Object &2 in library &3 not found.
|
|
</dd>
|
|
<dt><b>CPF9802</b></dt>
|
|
<dd>Not authorized to object &2 in &3.
|
|
</dd>
|
|
<dt><b>CPF9803</b></dt>
|
|
<dd>Cannot allocate object &2 in library &3.
|
|
</dd>
|
|
<dt><b>CPF9807</b></dt>
|
|
<dd>One or more libraries in library list deleted.
|
|
</dd>
|
|
<dt><b>CPF9808</b></dt>
|
|
<dd>Cannot allocate one or more libraries on library list.
|
|
</dd>
|
|
<dt><b>CPF9810</b></dt>
|
|
<dd>Library &1 not found.
|
|
</dd>
|
|
<dt><b>CPF9812</b></dt>
|
|
<dd>File &1 in library &2 not found.
|
|
</dd>
|
|
<dt><b>CPF9813</b></dt>
|
|
<dd>Record format &3 in file &1 not found.
|
|
</dd>
|
|
<dt><b>CPF9815</b></dt>
|
|
<dd>Member &5 file &2 in library &3 not found.
|
|
</dd>
|
|
<dt><b>CPF9820</b></dt>
|
|
<dd>Not authorized to use library &1.
|
|
</dd>
|
|
<dt><b>CPF9822</b></dt>
|
|
<dd>Not authorized to file &1 in library &2.
|
|
</dd>
|
|
<dt><b>CPF9826</b></dt>
|
|
<dd>Cannot allocate file &2.
|
|
</dd>
|
|
<dt><b>CPF9830</b></dt>
|
|
<dd>Cannot assign library &1.
|
|
</dd>
|
|
<dt><b>CPF9899</b></dt>
|
|
<dd>Error occurred during processing of command.
|
|
</dd>
|
|
</dl>
|
|
<p><b><u>*STATUS Messages</u></b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>CPI4011</b></dt>
|
|
<dd>Query running. &2 records selected, &1 processed.
|
|
</dd>
|
|
<dt><b>CPI4301</b></dt>
|
|
<dd>Query running.
|
|
</dd>
|
|
<dt><b>CPI4302</b></dt>
|
|
<dd>Query running. Building access path for &2 in &1.
|
|
</dd>
|
|
<dt><b>CPI4303</b></dt>
|
|
<dd>Query running. Creating copy of file &1 in &2.
|
|
</dd>
|
|
<dt><b>CPI4304</b></dt>
|
|
<dd>Query running. &1 records selected. Selection complete.
|
|
</dd>
|
|
<dt><b>CPI4305</b></dt>
|
|
<dd>Query running. Sorting copy of file *N in *N.
|
|
</dd>
|
|
<dt><b>CPI4306</b></dt>
|
|
<dd>Query running. Building access path from file &1 in &2.
|
|
</dd>
|
|
<dt><b>CPI4307</b></dt>
|
|
<dd>Query running. Building hash table from &2 in &1.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#OPNQRYF.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
</body>
|
|
</html>
|