ILE C/C++ Programmer's Guide


Creating Externally Described Database Files

Externally described files are files that have their field descriptions stored as part of the file. The description includes information about the type of file (such as data or device), record formats, and a description of each field and its attributes.

You can create an externally described database file using any of the following:

C language onlyThe ILE C preprocessor automatically creates C structure type definitions from external file descriptions when you use the #pragma mapinc directive with the #include directive.
Note:
You cannot use the #pragma mapinc directive if you are compiling IFS files. For more information about including IFS files in a program, see Appendix A, The GENCSRC Utility and the #pragma mapinc Directive.

The #pragma mapinc directive identifies only those file formats and fields to the compiler; it does not include the file description in the ILE C program. To include a file description, the #include directive must be coded in the ILE C program.

You refer to the include-name parameter of the #pragma mapinc directive on the #include. The #include directive must be coded after the #pragma mapinc directive in your source program.

For example, to include a type definition of the input fields for the record format FMT from the file EXAMPLE/TEST, the following statements must appear in your program in the order shown below:


#pragma mapinc("tempname","EXAMPLE/TEST(FMT)","input","d",,"")
#include "tempname"


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