ibm-information-center/dist/eclipse/plugins/i5OS.ic.ddm_5.4.0.1/rbae5nqueryx.htm

100 lines
6.4 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="Non-iSeries or non-System/38 Query/38 example" />
<meta name="abstract" content="This example shows how to create a local file and use it to define the data that is to be queried in a non-iSeries or non-System/38 remote file." />
<meta name="description" content="This example shows how to create a local file and use it to define the data that is to be queried in a non-iSeries or non-System/38 remote file." />
<meta name="DC.Relation" scheme="URI" content="rbae5sys38tools.htm" />
<meta name="DC.Relation" scheme="URI" content="rbae5qryutil.htm" />
<meta name="DC.Relation" scheme="URI" content="rbae5optmize.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbae5nqueryx" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Non-iSeries or non-System/38 Query/38 example</title>
</head>
<body id="rbae5nqueryx"><a name="rbae5nqueryx"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Non-<span class="keyword">iSeries</span> or non-<span class="keyword">System/38</span> Query/38 example</h1>
<div><p>This example shows how to create a local file and use it to define
the data that is to be queried in a non-<span class="keyword">iSeries™</span> or
non-<span class="keyword">System/38™</span> remote file.</p>
<div class="section"><p>Assume that a DDM file named RMTS36FILE exists on your <span class="keyword">iSeries server</span> and it refers to a remote <span class="keyword">System/36™</span> file that you want to query.
You can perform the following steps to: determine the attributes of the remote <span class="keyword">System/36</span> file; locally create a physical
file that has the attributes of the remote file; and define, create, and run
the Query/38 against the remote file. </p>
</div>
<div class="section"> <ol><li>Use the <span class="cmdname">Display File Field Description (DSPFFD)</span> command
and specify SYSTEM(*RMT) to display the attributes of the remote file associated
with the RMTS36FILE DDM file. <pre>DSPFFD FILE(RMTS36FILE) SYSTEM(*RMT)</pre>
<p>In
this example, the displayed results would show that the remote file's record
length is 80 characters, its record format name is RMTS36FILE, and it has
two fields: K00001, with 12 characters (starting in position 1), and F00001,
with 68 characters (starting in position 13). The K in field K00001 indicates
it is the key field for this format.</p>
</li>
<li>Using the DDS and the preceding information
before defining your Query/38 application, create a local physical file and
call it LCLS36FILE. The DDS might look something like this: <pre> A R RMTS36FILE
A CUSNO 6A
A BILLCODE 6A
A ADDR1 15A
A ADDR2 15A
A ADDR3 15A
A ZIP 5A
A AMTOWE 7S 2
A OUTBAL 7S 2
A MISC 4A
A K CUSNO
A K BILLCODE</pre>
<div class="p">Three main rules must be followed
when defining the local file: <ul><li>The record format name must be the same as the record format name displayed
by the <span class="cmdname">Display File Field Description (DSPFFD)</span> command.</li>
<li>Key integrity must be maintained. In this case, the key must be 12 characters
long, and must start at the beginning of the file in position 1.</li>
<li>The total record length must be the same as the record length displayed
by the <span class="cmdname">DSPFFD</span> command.</li>
</ul>
</div>
</li>
<li>Define your Query/38 application using the local file created in step
2. Because the remote file is a non-<span class="keyword">iSeries</span> file,
OPTIMIZE(*NO) should be specified on the query command.</li>
<li>Before your Query/38 application is run, issue the following Override
Database File (OVRDBF) command: <pre>OVRDBF FILE(LCLS36FILE) TOFILE(RMTS36FILE)</pre>
<p>When
the Query/38 application is run, this command overrides the local file you
created with the DDM file that is associated with the desired target file.</p>
</li>
<li>Run your Query/38 application using the <span class="cmdname">Query Data (QRYDTA)</span> command.
The net effect is that a query of the remote file is done using the local
file description.</li>
</ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbae5sys38tools.htm" title="The topic collection describes the System/38-compatible data file utility (DFU/38) and the System/38-compatible query utility (Query/38).">System/38-compatible database tools</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="rbae5qryutil.htm" title="The System/38-compatible query utility (Query/38) can be used with DDM to create and use interactive or batch query applications.">System/38-compatible query utility (Query/38)</a></div>
<div><a href="rbae5optmize.htm" title="Query/38 has an optimization function, but because it causes i5/OS database query to be used, the feature cannot be used when the query is performed against a remote file that is not on an iSeries server or a System/38.">Query/38 optimization for DDM</a></div>
</div>
</div>
</body>
</html>