The BOTH Option
- One type definition contains all fields defined as INPUT or BOTH; the other contains all fields defined as OUTPUT, or BOTH.
- One type definition structure is generated for each format that is specified when all fields are defined as BOTH, and a separate indicator area is not specified.
If you are including the external file description for only one record format, a type definition union is automatically created containing the two type definitions. The name of this type definition union is LIBRARY_FILE_FMT_both_t. If you specify a union-type-name on the #pragma mapinc directive, the name that is generated is union-type-name_t.
C++ users must use the GENCSRC utility for type
definitions.
C users can use either the GENCSRC utility or the #pragma
mapinc directive for type definitions.
A INDARA
A R FMT
A CF01(50)
A CF02(51)
A CF03(99 'EXIT')
A 1 35'PHONE BOOK'
A DSPATR(HI)
A 7 28'Name:'
A NAME 11A I 7 34
A 9 25'Address:'
A ADDRESS 20A O 9 34
A 11 25'Phone #:'
A PHONE_NUM 8A O 11 34
A 23 34'F3 - EXIT'
When the DDS shown above is included in your ILE C program,
the following structure is generated: #pragma mapinc("example/screen1","example/test(fmt)","both","d")
#include "example/screen1" /* -----------------------------------------------------------------
/* DEVICE FILE: EXAMPLE/TEST
/* FILE CREATION DATE: 93/09/01
/* RECORD FORMAT: FMT
/* FORMAT LEVEL IDENTIFIER: 371E00A681EA7
/* -----------------------------------------------------------------
/* INDICATORS FOR FORMAT FMT
/* INDICATOR 50
/* INDICATOR 51
/* INDICATOR 99
/* -----------------------------------------------------------------
typedef struct {
char NAME[11];
}EXAMPLE_TEST_FMT_i_t;
typedef struct {
char ADDRESS[20];
char PHONE_NUM[8];
}EXAMPLE_TEST_FMT_o_t;
typedef union {
EXAMPLE_TEST_FMT_i_t EXAMPLE_TEST_FMT_i;
EXAMPLE_TEST_FMT_o_t EXAMPLE_TEST_FMT_o;
}EXAMPLE_TEST_FMT_both_t;
This shows the structure definitions that are created when the format FMT in the device file EXAMPLE⁄TEST is included in your program. The external file description contains three indicators IN50, IN51, and IN99, and the DDS keyword INDARA. The indicators will appear as comments and will not be included in the structure because the option INDICATOR was not specified in the #pragma mapinc directive.