ILE C/C++ Programmer's Guide


Part 8. Appendixes


Appendix A. The GENCSRC Utility and the #pragma mapinc Directive

By using the Generate C/C++ Source (GENCSRC) utility to generate database header files, you can:

GENCSRC provides the means to retrieve externally described file information for use in a C/C++ program. The utility creates a C/C++ header file which contains the type definition structure for the include file.

The #pragma mapinc directive uses the GENCSRC command to provide the opportunity to convert DDS files to include files directly.

To compare the GENCSRC utility and the #pragma mapinc directive:

The following table shows the comparison of #pragma mapinc options and the keywords for GENCSRC. For more information on any particular option, refer to the description of #pragma mapinc in WebSphere Development Studio: ILE C/C++ Compiler Reference.

Table 36. Comparison of GENCSRC Keywords and #pragma mapinc Options

GENCSRC Keyword #pragma mapinc option Description
SRCFILE member_name The name of the file that you reference on the #include directive in the source program. The output file is generated in the Data Management file system.
SRCMBR member_name The name of member with the header information. It follows the iSeries naming conventions. The output file is generated in the Data Management file system.
OBJ file_name The path name of the object to map in QSYS file system.
SRCSTMF member_name The output file is generated in the IFS file system.
RCDFMT format_name Indicates the DDS record format to be included in your program. The default is *ALL.
SLTFLD options Restricted to a combination of the following values:
  • *INPUT
  • *OUTPUT
  • *BOTH (default)
  • *KEY
  • *INDICATOR
  • *LVLCHK1
  • *NULLFLDS
PKDDECFLD d or p *DECIMAL or *CHAR
STRUCTURES _P *NONPACKED or *PACKED
ONEBYTE 1BYTE_CHAR *CHAR or *ARRAY
UNIONDFN union_name *OBJ , NONE , or union_name
Note:
*OBJ is the default and the default type definition union name is FILE_t and not LIBRARY_FILE_FMT_both_t as described in the #pragma mapinc directive
TYPEDEFPFX prefix_name *OBJ or *NONE1

Notes:

  1. For more information, see Level Checking to Verify Descriptions.

Note:
For information about DDS-to-C/C++ data type mapping, see the WebSphere Development Studio: ILE C/C++ Compiler Reference.


[ Top of Page | Previous Page | Next Page | Table of Contents ]