ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahz_5.4.0.1/rfile.htm

126 lines
6.8 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Rfile - Read or write record files</title>
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</HEAD>
<body bgcolor="#FFFFFF">
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h2>Rfile - Read or write record files</h2>
<strong>Synopsis</strong>
<p><strong>Rfile -r | -w | -h [-abKlqQs] [-c</strong> <em>CL-command</em><strong>]</strong> <strong>[-C</strong> <em>CL-command</em><strong>]</strong> <em>file ...</em></p>
<p><strong>Description</strong></p>
<p>The <strong>Rfile</strong> utility reads i5/OS<SUP>(TM)</SUP> record files (database or device files) and writes the data to standard output, or reads standard input and writes the data to record files.</p>
<table>
<tr>
<td valign="top"><strong>Note:</strong></td>
<td>This utility is unique to i5/OS<SUP>(TM)</SUP>.</td>
</tr>
</table>
<p><strong>Options</strong></p>
<dl>
<dt><strong>-a</strong></dt>
<dd>Append the contents of standard input to the record file. This option only applies when <strong>-w</strong> is specified. If <strong>-w</strong> is specified without <strong>-a</strong>, any physical file member is cleared before writing the contents of the stream.</dd>
<p></p>
<dt><strong>-b</strong></dt>
<dd>Process binary data. This option prevents normal processing for newline characters in the input or output stream. When <strong>-b</strong> is omitted, newline characters are removed from standard input lines written to a record file, and newline characters are inserted at the end of records written to standard output.</dd>
<p></p>
<dt><strong>-c</strong> <em>CL-command</em></dt>
<dd>Run a CL command in the utility process before processing any record file. This option can be used to run a CL override command that specifies device-dependent parameters for a record file. If more than one <strong>-c</strong> option is specified, the CL commands are processed in sequence before processing any record file.</dd>
<p></p>
<dt><strong>-C</strong> <em>CL-command</em></dt>
<dd>Run a CL command in the utility process after processing all record files. If more than one <strong>-C</strong> option is specified, the CL commands are processed in sequence after processing all record files.</dd>
<p></p>
<dt><strong>-h</strong></dt>
<dd>Write a brief description of command syntax to standard error.</dd>
<p></p>
<dt><strong>-K</strong></dt>
<dd>Keep the job log at job termination. The system normally deletes the job log after running a QShell utility. This option forces the system to produce a job log listing (which may assist with problem determination) when the job that runs <strong>Rfile</strong> ends.</dd>
<p></p>
<dt><strong>-l</strong></dt>
<dd>Do not truncate long text lines. This option only applies to text data. When <strong>-l</strong> is specified, any standard input line longer than one output record is folded onto as many records as necessary, and no trailing blanks are removed from records written to standard output.</dd>
<p></p>
<dt><strong>-q</strong></dt>
<dd>Suppress warning messages. This option suppresses messages normally written to standard error when long text lines are truncated or folded in the output file.</dd>
<p></p>
<dt><strong>-Q</strong></dt>
<dd>Use i5/OS<SUP>(TM)</SUP> qualified name syntax for file names. When this option is specified, the file names specified as command operands are i5/OS<SUP>(TM)</SUP> qualified names (instead of Integrated File System path names).</dd>
<p></p>
<dt><strong>-r</strong></dt>
<dd>Read the specified record files and write their contents to standard output. Either <strong>-r</strong> or <strong>-w</strong>, but not both, must be specified.</dd>
<p></p>
<dt><strong>-s</strong></dt>
<dd>Process source sequence number and date fields as text. This option only applies to text processing of FILETYPE(*SRC) record files. When <strong>-s</strong> is specified, the entire contents of every record is processed as a text line. If <strong>-s</strong> is omitted, the first 12 bytes is stripped from every source record read, and the first 12 bytes of every source record written is filled with a sequence number and zeros for the date field.</dd>
<p></p>
<dt><strong>-w</strong></dt>
<dd>Read standard input and write its contents to the specified record file. The output file must already exist, or an error is reported (and no file is created). Either <strong>-r</strong> or <strong>-w</strong>, but not both, must be specified.</dd>
</dl>
<p><strong>Operands</strong></p>
<p>At least one i5/OS<SUP>(TM)</SUP> record file name must be specified. If more than one file is specified, they are processed in sequence as end of file is reached on each input source. When option <strong>-Q</strong> is omitted, files are identified by path names in the Integrated File System. If option <strong>-Q</strong> is specified, file names are specified in any of these forms:</p>
<pre>
file
library/file
'file(member)'
'library/file(member)'
</pre>
<p>If the library name is omitted or *LIBL is specified for the library name, the file is located using the job library list. If the member name is omitted or *FIRST is specified as the member name, the first member of a database file is opened. Specifying *LAST for the member name opens the last member of a database file. Member name *ALL can be used with option <strong>-r</strong> to read all members of a database file (from first to last). Member names are ignored for device files (when specified in i5/OS<SUP>(TM)</SUP> qualified name form).</p>
<p><strong>Examples</strong></p>
<ol>
<li>Read the contents of source database member QSYSINC/H(SQLCLI), and write it to standard output. Trailing blanks are removed from each line, as are the first 12 characters of each line (containing sequence number and date information):
<pre>
Rfile -rQ 'qsysinc/h(sqlcli)'
</pre>
</li>
<li>Write the contents of stream file mydoc.ps to spooled printer device file QPRINT as unconverted ASCII data, and then use the CL LPR command to send the spool file to another system:
<pre>
before='ovrprtf qprint devtype(*userascii) spool(*yes)'
after="lpr file(qprint) system(usrchprt01) prtq('rchdps') transform(*no)"
cat -c mydoc.ps | Rfile -wbQ -c "$before" -C "$after" qprint
</pre>
</li>
<li>Copy the contents of save file INSAVF in library QGPL to another save file named OUTSAVF located using the job library list. Note that the data is read and written in binary mode to avoid ASCII/EBCDIC conversion and newline processing:
<pre>
Rfile -rb /qsys.lib/qgpl.lib/insavf.file | Rfile -wbQ outsavf
</pre>
</li>
</ol>
<!-- end ibmbody========================================================= -->
</body>
</html>