91 lines
5.7 KiB
HTML
91 lines
5.7 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="reference" />
|
|
<meta name="DC.Title" content="DDM example 3: Access multiple iSeries files" />
|
|
<meta name="abstract" content="Using the same communications environment as in the previous examples, this example is used to ask inventory questions of identically named files on the two remote iSeries servers and the remote System/38." />
|
|
<meta name="description" content="Using the same communications environment as in the previous examples, this example is used to ask inventory questions of identically named files on the two remote iSeries servers and the remote System/38." />
|
|
<meta name="DC.subject" content="system, iSeries, accessing files, multiple, accessing, multiple files, multiple, file" />
|
|
<meta name="keywords" content="system, iSeries, accessing files, multiple, accessing, multiple files, multiple, file" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbae5code.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="rbae5apaex3" />
|
|
<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>DDM example 3: Access multiple iSeries files</title>
|
|
</head>
|
|
<body id="rbae5apaex3"><a name="rbae5apaex3"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">DDM example 3: Access multiple <span class="keyword">iSeries</span> files</h1>
|
|
<div><p>Using the same communications environment as in the previous examples,
|
|
this example is used to ask inventory questions of identically named files
|
|
on the two remote <span class="keyword">iSeries™ server</span>s
|
|
and the remote <span class="keyword">System/38™</span>.</p>
|
|
<div class="section"><p>To do so, a program must be written (shown here in pseudocode)
|
|
on the central server that can access the files named LIB/MASTER on the servers
|
|
in Chicago, in Toronto, and in New York. (In this example, the MASTER files
|
|
are keyed files, and the first member of each of these files is the one used.
|
|
Also, data description specifications (DDS) for the MASTER files exist on
|
|
the central server in Philadelphia.)</p>
|
|
</div>
|
|
<div class="section"><p>The program asks the local order entry operator for an item number
|
|
(ITEMNO), and returns the quantity-on-hand (QOH) information from the files
|
|
in Chicago, Toronto, and New York.</p>
|
|
</div>
|
|
<div class="section"><p>The following commands are issued on the server in Philadelphia:</p>
|
|
<pre>CRTDDMF PGMLIB/CHIFILE RMTFILE(*NONSTD 'MASTER.LIB')
|
|
RMTLOCNAME(CHIC)
|
|
CRTDDMF PGMLIB/TORFILE RMTFILE(LIB/MASTER) RMTLOCNAME(TOR)
|
|
CRTDDMF PGMLIB/NYCFILE RMTFILE(LIB/MASTER) RMTLOCNAME(NYC)</pre>
|
|
</div>
|
|
<div class="section"><p>Here is a sample of the pseudocode to accomplish
|
|
the task:</p>
|
|
<div class="note"><span class="notetitle">Note:</span> By using the code examples, you agree to the terms of the <a href="codedisclaimer.htm">Code license and disclaimer information</a>.</div>
|
|
</div>
|
|
<div class="example"> <pre id="rbae5apaex3__sec"><a name="rbae5apaex3__sec"><!-- --></a>DECLARE CHIFILE, TORFILE, NYCFILE INPUT
|
|
Open CHIFILE, TORFILE and NYCFILE
|
|
LOOP: Show a display asking for ITEMNO
|
|
Read ITEMNO from the display
|
|
Read record from CHIFILE with the key ITEMNO
|
|
Read record from TORFILE with the key ITEMNO
|
|
Read record from NYCFILE with the key ITEMNO
|
|
Write all QOH values to the display
|
|
If not function key, go to LOOP
|
|
Close CHIFILE, TORFILE and NYCFILE
|
|
END</pre>
|
|
</div>
|
|
<div class="section"><p>Before the program is compiled, <span class="cmdname">Override with Database
|
|
File (OVRDBF)</span> commands can be used to override the three files used
|
|
in the program with local files that contain the external description formats,
|
|
identical to the remote files being accessed. Doing so significantly reduces
|
|
the time required for the compile, since the files on the remote server do
|
|
not have to be accessed then.</p>
|
|
</div>
|
|
<div class="section"><p>After the program has been compiled correctly, the overrides should
|
|
be deleted so that the program is able to access the remote files.</p>
|
|
</div>
|
|
<div class="section"><p>An alternative to the use of overrides is to keep the file definitions
|
|
in a different library. The program can be compiled using the file definitions
|
|
in that library and then run using the real library.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbae5code.htm" title="The examples in this topic collection are based on representative application programs that might be used for processing data both on the local iSeries server and on one or more remote servers.">Examples: Code DDM-related tasks</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |