mapinc

C compiler only

mapinc syntax

Read syntax diagramSkip visual syntax diagram#pragmamapinc( "include_name"," *LIBL/*CURLIB/library_name/ file_name (*ALLformat_name) ","options"," dp z_P1BYTE_CHAR " ,"union_type_name","prefix_name" )

Description

Indicates that data description specifications (DDS) are to be included in a module. The directive identifies the file and DDS record formats, and provides information about the fields to be included. This pragma, along with its associated include directive, causes the compiler to automatically generate typedefs from the record formats that are specified in the external file descriptions.

Parameters
include_name
This is the name that you refer to on the #include directive in the source program.
library_name
This is the name of the library that contains the externally described file
file_name
This is the name of the externally described file.
format_name
This is a required parameter which indicates the DDS record format that is to be included in your program. You can include more than one record format (format1 format2), or all the formats in a file (*ALL).
options
The possible options are:
input
Fields declared as either INPUT or BOTH in the DDS are included in the typedef structure. Response indicators are included in the input structure when the keyword INDARA is not specified in the external file description (DDS source) for device files.
output
Fields declared as either OUTPUT or BOTH in DDS are included in the typedef structure. Option indicators are included in the output structure when the keyword INDARA is not specified in the external file description (DDS source) for device files.
both
Fields declared as INPUT, OUTPUT, or BOTH in DDS are included in the typedef structure. Option and response indicators are included in both structures when the keyword INDARA is not specified in the external file description (DDS source) for device files.
key
Fields that are declared as keys in the external file description are included. This option is only valid for database files and DDM files.
indicators
A separate 99-byte structure for indicators is created when the indicator option is specified. This option is only valid for device files.
lname
This option allows the use of file names of up to 128 characters in length. If the file name has more than 10 characters then the name will be converted to an associated short name. The short name will be used to extract the external file definition. When the file has a short name of 10 characters or less the name is not converted to an associated short name. Record field names up to 30 characters in length will be generated in the typedefs by the compiler.
lvlchk
A typedef of an array of struct is generated (type name _LVLCHK_T) for the level check information. 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).
nullflds
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, the user can specify which fields are to be considered null (set value of each null field to 1, otherwise set to zero). Also, if the key option is used along with option nullflds, 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.

For physical and logical files you can specify input, both, key, lvlchk, and nullflds. For device files you can specify input, output, both, indicator, and lvlchk.

The data type can be one or more of the following and must be separated by spaces.
d
Packed decimal data type.
p
Packed fields from DDS are declared as character fields.
z
Zoned fields from DDS are declared as character fields. This is the default because the compiler does not have a zoned data type.
_P
Packed structure is generated.
1BYTE_CHAR
Generates a single byte character field for one byte characters that are defined in DDS.
" "
Default values of d and z are used.
union_type_name
A union definition of the included type definitions is created with the name union_type_name_t. This parameter is optional.
prefix_name
Specifies the first part of the generated typedef structure name. If the prefix is not specified, the library and file_name are used.

Notes on Usage

See Using Externally Described Files in a Program in the ILE C/C++ Programmer's Guide for more information about using the #pragma mapinc directive with externally described files.