ibm-information-center/dist/eclipse/plugins/i5OS.ic.rbam6_5.4.0.1/refof.htm

90 lines
5.5 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="task" />
<meta name="DC.Title" content="Refer to output files from display commands" />
<meta name="abstract" content="A number of the IBM display commands allow you to place the output from the command into a database file (OUTFILE parameter). The data in this file can be received directly into a CL procedure or program and processed." />
<meta name="description" content="A number of the IBM display commands allow you to place the output from the command into a database file (OUTFILE parameter). The data in this file can be received directly into a CL procedure or program and processed." />
<meta name="DC.subject" content="database file, referring to output file" />
<meta name="keywords" content="database file, referring to output file" />
<meta name="DC.Relation" scheme="URI" content="wfile.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="refof" />
<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>Refer to output files from display commands</title>
</head>
<body id="refof"><a name="refof"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Refer to output files from display commands</h1>
<div><p>A number of the IBM<sup>®</sup> display commands allow you to place the output from
the command into a database file (OUTFILE parameter). The data in this file
can be received directly into a CL procedure or program and processed.</p>
<div class="section"> <p>The following CL procedure accepts two parameters, a user name
and a library name. The procedure determines the names of all programs, files,
and data areas in the library and grants normal authority to the specified
users. </p>
<pre> PGM PARM(&amp;USER &amp;LIB)
DCL &amp;USER *CHAR 10
DCL &amp;LIB *CHAR 10
(1) DCLF QSYS/QADSPOBJ
(2) DSPOBJD OBJ(&amp;LIB/*ALL) OBJTYPE(*FILE *PGM *DTAARA) +
OUTPUT(*OUTFILE) OUTFILE(QTEMP/DSPOBJD)
(3) OVRDBF QADSPOBJ TOFILE(QTEMP/DSPOBJD)
(4) READ: RCVF
(5) MONMSG CPF0864 EXEC(RETURN) /* EXIT WHEN END OF FILE REACHED */
(6) GRTOBJAUT OBJ(&amp;ODLBNM/&amp;ODOBNM) OBJTYPE(&amp;ODOBTP) +
USER(&amp;USER) AUT(*CHANGE)
GOTO READ /*GO BACK FOR NEXT RECORD*/
ENDPGM</pre>
<dl><dt class="dlterm">(1)</dt>
<dd>The declared file, QADSPOBJ in QSYS, is the IBM-supplied file that is
used by the <span class="cmdname">Display Object Description (DSPOBJD)</span> command.
This file is the primary file which is referred to by the command when creating
the output file. It is referred to by the CL compiler to determine the format
of the records and to declare variables for the fields in the record format.</dd>
<dt class="dlterm">(2)</dt>
<dd>The <span class="cmdname">Display Object Description (DSPOBJD)</span> command creates
a file named DSPOBJD in library QTEMP. This file has the same format as file
QADSPOBJ.</dd>
<dt class="dlterm">(3)</dt>
<dd>The <span class="cmdname">Override with Database File (OVRDBF)</span> command overrides
the declared file (QADSPOBJ) to the file created by the <span class="cmdname">Display Object
Description (DSPOBJD)</span> command.</dd>
<dt class="dlterm">(4)</dt>
<dd>The <span class="cmdname">Receive File (RCVF)</span> command reads a record from
the DSPOBJD file. The values of the fields in the record are copied into
the corresponding CL variables, which were implicitly declared by the <span class="cmdname">Declare
File (DCLF)</span> command. Because the <span class="cmdname">Override with Database
File (OVRDBF)</span> command was used, the file QTEMP/DSPOBJD is read instead
of QSYS/QADSPOBJ (the file QSYS/QADSPOBJ is not read).</dd>
<dt class="dlterm">(5)</dt>
<dd>Message CPF0864 is monitored. This indicates that the end of file has
been reached, so the procedure returns control to the calling procedure.</dd>
<dt class="dlterm">(6)</dt>
<dd>The <span class="cmdname">Grant Object Authority (GRTOBJAUT)</span> command is processed,
using the variables for object name, library name and object type, which were
read by the <span class="cmdname">Receive File (RCVF)</span> command.</dd>
</dl>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="wfile.htm" title="Two types of files are supported in CL procedures and programs: display files and database files.">Work with files in CL procedures</a></div>
</div>
</div>
</body>
</html>