Creating Header Descriptions

The header description for each format contains the following information:
  • File and library name of the external file
  • File type (physical, logical, device)
  • Date the file was created
  • Record format name
  • Record format level ID (level checking information)
C language only For example, the following directives are used to create the header shown below:
#pragma mapinc("payroll","example/test(fmt1)","input","")
#include "payroll"
Figure 1. Header Description
/* ------------------------------------------------------------------ */
/* PHYSICAL FILE: EXAMPLE/TEST                                        */
/* FILE CREATION DATE: 93/09/01                                       */
/* RECORD FORMAT: FMT1                                                */
/* FORMAT LEVEL IDENTIFIER: 371E00A681EA7                             */
/* ------------------------------------------------------------------ */
The following is an example of a type definition of type structure:
typedef struct {
        .
        .
        .
} LIBRARY_FILE_FORMAT_tag_t;

C language onlyParameters of the #pragma mapinc directive are used to create the name of the created type. LIBRARY, FILE, and FORMAT are the library-name, file-name, and format-name specified on the #pragma mapinc directive. These names are folded to uppercase unless quoted names are used. The library and file names can be replaced with your own prefix-name as specified on the #pragma mapinc directive.

C language onlyAny characters that are not recognized as valid by the C language that appear in library and file names are translated to the underscore (_) character.
Note: Do not use the special characters #, @, or $ in library and file names. If these characters are used in library and file names, they are also translated to the underscore (_) character.
The tag on the structure name indicates the type of fields that are included in the structure definition. The possible values for tag are:
Table 1. Field Type and Tag Values
Field Type Tag
input i
output o
both both
key key
indicators indic
nullflds nmap/nkmap

Unlike the naming convention used for other listed field types, if field type lvlchk is specified, the name of the array of structure type created is _LVLCHK_T.

C language onlyTo include external file descriptions for more than one format, specify more than one format name (format1 format2) or (*ALL) on the #pragma mapinc directive. A header description and type definitions are created for each format.

When the lname option is specified and the filename in the #pragma mapinc directive is greater than 10 characters in length, a system-generated 10-character name will be used in the type definitions generated by the compiler.