374 lines
14 KiB
HTML
374 lines
14 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>Create Query Management Query (CRTQMQRY)</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="CRTQMQRY.Top_Of_Page"></a>
|
||
|
<h2>Create Query Management Query (CRTQMQRY)</h2>
|
||
|
<table width="100%">
|
||
|
<tr>
|
||
|
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
|
||
|
<b>Threadsafe: </b>No
|
||
|
</td>
|
||
|
<td valign="top" align="right">
|
||
|
<a href="#CRTQMQRY.PARAMETERS.TABLE">Parameters</a><br>
|
||
|
<a href="#CRTQMQRY.COMMAND.EXAMPLES">Examples</a><br>
|
||
|
<a href="#CRTQMQRY.ERROR.MESSAGES">Error messages</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<div> <a name="CRTQMQRY"></a>
|
||
|
<p>The Create Query Management Query (CRTQMQRY) command allows you to create a query management query from a specified source file member. The source for a query is a single Structured Query Language (SQL) statement that can contain variable substitution values and embedded comments. It can be spread over multiple records in a source file member.
|
||
|
</p>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<hr size="2" width="100%">
|
||
|
|
||
|
<div>
|
||
|
<h3><a name="CRTQMQRY.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="3"><a href="#CRTQMQRY.QMQRY"><b>QMQRY</b></a></td>
|
||
|
<td valign="top">Query management query</td>
|
||
|
<td valign="top"><i>Qualified object name</i></td>
|
||
|
<td valign="top" rowspan="3">Required, Positional 1</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top">Qualifier 1: Query management query</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>*CURLIB</u></b></td>
|
||
|
</tr><tr>
|
||
|
<td valign="top" rowspan="3"><a href="#CRTQMQRY.SRCFILE"><b>SRCFILE</b></a></td>
|
||
|
<td valign="top">Source file</td>
|
||
|
<td valign="top"><i>Qualified object name</i></td>
|
||
|
<td valign="top" rowspan="3">Optional, Positional 2</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top">Qualifier 1: Source file</td>
|
||
|
<td valign="top"><i>Name</i>, <b><u>QQMQRYSRC</u></b></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="#CRTQMQRY.SRCMBR"><b>SRCMBR</b></a></td>
|
||
|
<td valign="top">Source member</td>
|
||
|
<td valign="top"><i>Name</i>, <b><u>*QMQRY</u></b></td>
|
||
|
<td valign="top">Optional, Positional 3</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top"><a href="#CRTQMQRY.TEXT"><b>TEXT</b></a></td>
|
||
|
<td valign="top">Text 'description'</td>
|
||
|
<td valign="top"><i>Character value</i>, <b><u>*SRCMBRTXT</u></b>, *BLANK</td>
|
||
|
<td valign="top">Optional</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top" rowspan="3"><a href="#CRTQMQRY.SRTSEQ"><b>SRTSEQ</b></a></td>
|
||
|
<td valign="top">Sort sequence</td>
|
||
|
<td valign="top"><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>, <b><u>*SRC</u></b>, *JOBRUN, *JOB, *HEX, *LANGIDSHR, *LANGIDUNQ</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="#CRTQMQRY.LANGID"><b>LANGID</b></a></td>
|
||
|
<td valign="top">Language ID</td>
|
||
|
<td valign="top"><i>Character value</i>, <b><u>*SRC</u></b>, *JOBRUN, *JOB</td>
|
||
|
<td valign="top">Optional</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top"><a href="#CRTQMQRY.AUT"><b>AUT</b></a></td>
|
||
|
<td valign="top">Authority</td>
|
||
|
<td valign="top"><i>Name</i>, *USE, *CHANGE, *ALL, *EXCLUDE, <b><u>*LIBCRTAUT</u></b></td>
|
||
|
<td valign="top">Optional</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top"><a href="#CRTQMQRY.REPLACE"><b>REPLACE</b></a></td>
|
||
|
<td valign="top">Replace object</td>
|
||
|
<td valign="top"><b><u>*YES</u></b>, *NO</td>
|
||
|
<td valign="top">Optional</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div> <a name="CRTQMQRY.QMQRY"></a>
|
||
|
<h3>Query management query (QMQRY)</h3>
|
||
|
<p>Specifies the query management query to be created.
|
||
|
</p>
|
||
|
<p>This is a required parameter.
|
||
|
</p>
|
||
|
<p><b>Qualifier 1: Query management query</b>
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><i>name</i></b></dt>
|
||
|
<dd>Specify the name of the query to be created.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<p><b>Qualifier 2: Library</b>
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*CURLIB</u></b></dt>
|
||
|
<dd>The current library for the job is used to locate the query. 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 where the query is located.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CRTQMQRY.SRCFILE"></a>
|
||
|
<h3>Source file (SRCFILE)</h3>
|
||
|
<p>Specifies the source file containing the source for the query being created. The query is identified by the name specified on the QMQRY parameter.
|
||
|
</p>
|
||
|
<p><b>Qualifier 1: Source file</b>
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>QQMQRYSRC</u></b></dt>
|
||
|
<dd>IBM-supplied source file QQMQRYSRC contains the source for the query to be created.
|
||
|
</dd>
|
||
|
<dt><b><i>name</i></b></dt>
|
||
|
<dd>Specify the name of the file containing the source for the query to be created.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<p><b>Qualifier 2: Library</b>
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*LIBL</u></b></dt>
|
||
|
<dd>All libraries in the library list for the current thread are searched until the first match is found.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<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="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CRTQMQRY.SRCMBR"></a>
|
||
|
<h3>Source member (SRCMBR)</h3>
|
||
|
<p>Specifies the member of the source file member that contains source for the query to be created.
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*QMQRY</u></b></dt>
|
||
|
<dd>The member name is the same as the query name specified on the QMQRY parameter.
|
||
|
</dd>
|
||
|
<dt><b><i>name</i></b></dt>
|
||
|
<dd>Specify the name of the member that contains the query source.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CRTQMQRY.TEXT"></a>
|
||
|
<h3>Text 'description' (TEXT)</h3>
|
||
|
<p>Specifies the text that briefly describes the query management query.
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*SRCMBRTXT</u></b></dt>
|
||
|
<dd>The descriptive text for the object being created is the same as the text description of the source member. If the source member has no text description, or if it is blank, then TEXT(*BLANK) is assumed.
|
||
|
</dd>
|
||
|
<dt><b>*BLANK</b></dt>
|
||
|
<dd>No text is specified. If this command causes an object to be replaced, any existing text for the object is replaced with blank text.
|
||
|
</dd>
|
||
|
<dt><b><i>character-value</i></b></dt>
|
||
|
<dd>Specify no more than 50 characters of text, enclosed in apostrophes. The apostrophes are not part of the 50-character string.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CRTQMQRY.SRTSEQ"></a>
|
||
|
<h3>Sort sequence (SRTSEQ)</h3>
|
||
|
<p>Specifies the sort sequence table to be used for string comparisons in this query.
|
||
|
</p>
|
||
|
<p>
|
||
|
<b>Note: </b>This parameter is valid only when creating a query. This parameter is not valid when creating a FORM.
|
||
|
</p>
|
||
|
<p><b>Qualifier 1: Sort sequence</b>
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*SRC</u></b></dt>
|
||
|
<dd>The source file member contains the sort sequence to be used when creating the query.
|
||
|
</dd>
|
||
|
<dt><b>*JOBRUN</b></dt>
|
||
|
<dd>The SRTSEQ value for the job at the time the query is run is used.
|
||
|
</dd>
|
||
|
<dt><b>*JOB</b></dt>
|
||
|
<dd>The SRTSEQ value for the job at the time the query is created is used.
|
||
|
</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>*LANGIDUNQ</b></dt>
|
||
|
<dd>The unique-weight sort table for the language specified on the LANGID parameter is used.
|
||
|
</dd>
|
||
|
<dt><b>*LANGIDSHR</b></dt>
|
||
|
<dd>A shared-weight sort table for the language specified on the LANGID parameter is used.
|
||
|
</dd>
|
||
|
<dt><b><i>name</i></b></dt>
|
||
|
<dd>Specify the name of the sort sequence table to be used when this query is created.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<p><b>Qualifier 2: Library</b>
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*LIBL</u></b></dt>
|
||
|
<dd>All libraries in the library list for the current thread are searched until the first match is found.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<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="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CRTQMQRY.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>*SRC</u></b></dt>
|
||
|
<dd>The source file member contains the language ID to be used when the query is created.
|
||
|
</dd>
|
||
|
<dt><b>*JOBRUN</b></dt>
|
||
|
<dd>The LANGID value for the job is determined when the query is run.
|
||
|
</dd>
|
||
|
<dt><b>*JOB</b></dt>
|
||
|
<dd>The LANGID value for the job is determined when the query is created.
|
||
|
</dd>
|
||
|
<dt><b><i>language-ID</i></b></dt>
|
||
|
<dd>Specify the language identifier to be used for the query.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CRTQMQRY.AUT"></a>
|
||
|
<h3>Authority (AUT)</h3>
|
||
|
<p>Specifies the authority you are giving to users who do not have specific authority for the object, who are not on an authorization list, and whose group profile or supplemental group profiles do not have specific authority for the object.
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*LIBCRTAUT</u></b></dt>
|
||
|
<dd>The system determines the authority for the object by using the value specified for the <b>Create authority (CRTAUT)</b> parameter on the Create Library command (CRTLIB) for the library containing the object to be created. If the value specified for the CRTAUT parameter is changed, the new value will not affect any existing objects.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><b>*CHANGE</b></dt>
|
||
|
<dd>The user can perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><b>*ALL</b></dt>
|
||
|
<dd>The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the object.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><b>*USE</b></dt>
|
||
|
<dd>The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><b>*EXCLUDE</b></dt>
|
||
|
<dd>The user cannot access the object.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><b><i>name</i></b></dt>
|
||
|
<dd>Specify the name of an authorization list to be used for authority to the object. Users included in the authorization list are granted authority to the object as specified in the list. The authorization list must exist when the object is created.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CRTQMQRY.REPLACE"></a>
|
||
|
<h3>Replace object (REPLACE)</h3>
|
||
|
<p>Specifies whether an object with the same name and type in the library to receive the output is replaced with the output of this command.
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*YES</u></b></dt>
|
||
|
<dd>An existing object is replaced with the output of this command.
|
||
|
</dd>
|
||
|
<dt><b>*NO</b></dt>
|
||
|
<dd>An existing object is not replaced with the output of this command.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<hr size="2" width="100%">
|
||
|
<div><h3><a name="CRTQMQRY.COMMAND.EXAMPLES">Examples</a> </h3>
|
||
|
<p>
|
||
|
<pre>
|
||
|
CRTQMQRY QMQRY(NEWQRY) SRCFILE(RPTLIB/QRYSRC)
|
||
|
</pre>
|
||
|
</p>
|
||
|
<p>This command creates a query named NEWQRY in the current library. The query source is in member NEWQRY, which is located in source file QRYSRC in library RPTLIB.
|
||
|
</p>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<hr size="2" width="100%">
|
||
|
<div><h3><a name="CRTQMQRY.ERROR.MESSAGES">Error messages</a> </h3>
|
||
|
<p><b><u>*ESCAPE Messages</u></b>
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b>QWM2701</b></dt>
|
||
|
<dd>&1 command failed.
|
||
|
</dd>
|
||
|
<dt><b>QWM2703</b></dt>
|
||
|
<dd>&1 command ended.
|
||
|
</dd>
|
||
|
<dt><b>QWM2705</b></dt>
|
||
|
<dd>Source file &1 in &2 not available.
|
||
|
</dd>
|
||
|
<dt><b>QWM2706</b></dt>
|
||
|
<dd>&1 in &2 not replaced.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CRTQMQRY.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
</body>
|
||
|
</html>
|