ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/gencsrc.htm

349 lines
12 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Generate C/C++ Source (GENCSRC)</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="GENCSRC.Top_Of_Page"></a>
<h2>Generate C/C++ Source (GENCSRC)</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="#GENCSRC.PARAMETERS.TABLE">Parameters</a><br>
<a href="#GENCSRC.COMMAND.EXAMPLES">Examples</a><br>
<a href="#GENCSRC.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="GENCSRC"></a>
<p>The Generate C/C++ Source (GENCSRC) command maps externally-described file information to the equivalent structures that can be included into ILE C or ILE C++ programs. The structures generated from the specified file object are written to either a source file member or a stream file.
</p>
<h3>Error messages for GENCSRC</h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CZM2613</b></dt>
<dd>GENCSRC failed to generate include file.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="GENCSRC.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"><a href="#GENCSRC.OBJ"><b>OBJ</b></a></td>
<td valign="top">From object</td>
<td valign="top"><i>Path name</i></td>
<td valign="top">Optional, Positional 1</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#GENCSRC.SRCFILE"><b>SRCFILE</b></a></td>
<td valign="top">To source file</td>
<td valign="top"><i>Qualified object name</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Qualifier 1: To source file</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"><a href="#GENCSRC.SRCMBR"><b>SRCMBR</b></a></td>
<td valign="top">To source member</td>
<td valign="top"><i>Name</i>, <b><u>*OBJ</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#GENCSRC.SRCSTMF"><b>SRCSTMF</b></a></td>
<td valign="top">To source stream file</td>
<td valign="top"><i>Path name</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#GENCSRC.RCDFMT"><b>RCDFMT</b></a></td>
<td valign="top">Record format</td>
<td valign="top">Single values: <b><u>*ALL</u></b><br>Other values (up to 20 repetitions): <i>Name</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#GENCSRC.SLTFLD"><b>SLTFLD</b></a></td>
<td valign="top">Select fields</td>
<td valign="top">Values (up to 6 repetitions): *INPUT, *OUTPUT, <b><u>*BOTH</u></b>, *KEY, *INDICATOR, *LVLCHK, *NULLFLDS</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#GENCSRC.PKDDECFLD"><b>PKDDECFLD</b></a></td>
<td valign="top">Packed decimal fields</td>
<td valign="top"><b><u>*DECIMAL</u></b>, *CHAR</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#GENCSRC.STRUCTURE"><b>STRUCTURE</b></a></td>
<td valign="top">Structures</td>
<td valign="top">*NONPACKED, <b><u>*PACKED</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#GENCSRC.ONEBYTE"><b>ONEBYTE</b></a></td>
<td valign="top">1-byte character fields</td>
<td valign="top">*CHAR, <b><u>*ARRAY</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#GENCSRC.UNIONDFN"><b>UNIONDFN</b></a></td>
<td valign="top">Union definition name</td>
<td valign="top"><i>Character value</i>, <b><u>*OBJ</u></b>, *NONE</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#GENCSRC.TYPEDEFPFX"><b>TYPEDEFPFX</b></a></td>
<td valign="top">Typedef prefix</td>
<td valign="top"><i>Character value</i>, <b><u>*OBJ</u></b>, *NONE</td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="GENCSRC.OBJ"></a>
<h3>From object (OBJ)</h3>
<p>Specifies the path name of the object to map. The path name must identify a *FILE object in the QSYS file system.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="GENCSRC.SRCFILE"></a>
<h3>To source file (SRCFILE)</h3>
<p>Specifies the name of the physical file that will contain the generated structures. The physical file must exist.
</p>
<p>
<b>Note: </b>Ensure that the record length of the physical file is large enough to avoid truncation of the data.
</p>
<dl>
<dt><b><i>file-name</i></b></dt>
<dd>Specify the name of an existing file.
<p>The possible library values are:
</p>
<dl>
<dt><b><u>*CURLIB</u></b></dt>
<dd>The current library for the job is used to locate the physical file. If no current library entry exists in the library list, QGPL is used.
</dd>
<dt><b><i>library-name</i></b></dt>
<dd>Specify the name of the library where the file is located.
</dd>
</dl>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="GENCSRC.SRCMBR"></a>
<h3>To source member (SRCMBR)</h3>
<p>Specifies the name of the file member which will contain the mapped structures. If a member by this name does not exist, it will be added automatically. The records in an existing member by this name will be replaced.
</p>
<dl>
<dt><b><u>*OBJ</u></b></dt>
<dd>The object name derived from the OBJ parameter will be used as the member name.
</dd>
<dt><b><i>member-name</i></b></dt>
<dd>Specify the member name for the generated C/C++ structures.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="GENCSRC.SRCSTMF"></a>
<h3>To source stream file (SRCSTMF)</h3>
<p>Specifies the name of the stream file that will contain the generated structures. All directories in the stream file's path must exist. If a file by this name does not exist, it will be created automatically. The data in an existing file by this name will be replaced.
</p>
<dl>
<dt><b><i>file-name</i></b></dt>
<dd>Specify the complete path of the stream file.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="GENCSRC.RCDFMT"></a>
<h3>Record format (RCDFMT)</h3>
<p>Specifies which record formats of the file are to have C/C++ structures generated.
</p>
<dl>
<dt><b><u>*ALL</u></b></dt>
<dd>All record formats for the file will have structures generated.
</dd>
<dt><b><i>format-name</i></b></dt>
<dd>Specify which record formats will have structures generated. A maximum of 20 record formats can be specified.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="GENCSRC.SLTFLD"></a>
<h3>Select fields (SLTFLD)</h3>
<p>Specifies the usage type of fields that will be mapped.
</p>
<dl>
<dt><b><u>*BOTH</u></b></dt>
<dd>Fields declared as INPUT, OUTPUT, or BOTH in the DDS are included in the typedef structure. Option and response indicators are included in both structures unless the keyword INDARA is specified in the external file description for device files.
</dd>
<dt><b>*INPUT</b></dt>
<dd>Fields declared as either INPUT or BOTH are included in the mapped structures. Response indicators are included in the input structure unless the keyword INDARA is specified in the external file description for device files.
</dd>
<dt><b>*OUTPUT</b></dt>
<dd>Fields declared as either OUTPUT or BOTH are included in the record structures. Option indicators are included in the output structure unless the keyword INDARA is specified in the external file description for device files.
</dd>
<dt><b>*KEY</b></dt>
<dd>Fields declared as keys in the external file description are included. This option is only valid for database files and DDM files.
</dd>
<dt><b>*INDICATOR</b></dt>
<dd>A separate 99-byte structure for indicators is created when the indicator option is specified. This option is only valid for device files.
</dd>
<dt><b>*LVLCHK</b></dt>
<dd>A typedef of an array of struct is generated, named _LVLCHK_T. A pointer to an object of type _LVLCHK_T is also generated and is initialized with the level check information (format name and level identifier).
</dd>
<dt><b>*NULLFLDS</b></dt>
<dd>If there is at least one null-capable field in the record format of the DDS, a null map typedef is generated containing a character field for every field in the format. With this typedef, you can specify which fields are to be null (set value of each null field to '1', otherwise set to '0'). Also, if the *KEY option is used along with the *NULLFLDS option, and there is at least one null-capable key field in the format, an additional typedef is generated containing a character field for every key field in the format.
</dd>
</dl>
<p>For physical and logical files, you can specify *INPUT, *BOTH, *KEY, *LVLCHK, and *NULLFLDS. For device files you can specify *INPUT, *OUTPUT, *BOTH, *INDICATORS, and *LVLCHK.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="GENCSRC.PKDDECFLD"></a>
<h3>Packed decimal fields (PKDDECFLD)</h3>
<p>Specifies the mapping of packed decimal fields.
</p>
<dl>
<dt><b><u>*DECIMAL</u></b></dt>
<dd>Packed decimal fields are declared as _Decimal data types.
</dd>
<dt><b>*CHAR</b></dt>
<dd>Packed decimal fields are declared as character arrays.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="GENCSRC.STRUCTURE"></a>
<h3>Structures (STRUCTURE)</h3>
<p>Specifies whether or not packed structures are generated.
</p>
<dl>
<dt><b><u>*NONPACKED</u></b></dt>
<dd>Packed structures are not generated.
</dd>
<dt><b>*PACKED</b></dt>
<dd>Packed structures are generated.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="GENCSRC.ONEBYTE"></a>
<h3>1-byte character fields (ONEBYTE)</h3>
<p>Specifies whether an array or a single character is generated for one-byte fields.
</p>
<dl>
<dt><b><u>*CHAR</u></b></dt>
<dd>A single-byte character field is generated for one-byte characters.
</dd>
<dt><b>*ARRAY</b></dt>
<dd>A one-element array of char is generated for one-byte characters.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="GENCSRC.UNIONDFN"></a>
<h3>Union definition name (UNIONDFN)</h3>
<p>Specifies the union names generated.
</p>
<dl>
<dt><b><u>*OBJ</u></b></dt>
<dd>Use the file name derived from the OBJ parameter.
</dd>
<dt><b>*NONE</b></dt>
<dd>No union is generated.
</dd>
<dt><b><i>union-name</i></b></dt>
<dd>Generate a union definition with the name union-name_t. Maximum length is 50 characters.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="GENCSRC.TYPEDEFPFX"></a>
<h3>Typedef prefix (TYPEDEFPFX)</h3>
<p>Specifies the prefix for the generated structures.
</p>
<dl>
<dt><b><u>*OBJ</u></b></dt>
<dd>Use the file name derived from the OBJ parameter.
</dd>
<dt><b>*NONE</b></dt>
<dd>Do not use a prefix for the generated structures.
</dd>
<dt><b><i>prefix-name</i></b></dt>
<dd>Specify a prefix for the structure name. Maximum length is 50 characters.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="GENCSRC.COMMAND.EXAMPLES">Examples</a></h3>None
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="GENCSRC.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CZM2613</b></dt>
<dd>GENCSRC failed to generate include file.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#GENCSRC.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>