Creating a Separate Indicator Area
To use indicators as a separate structure you must specify:
- the DDS keyword INDARA in the external description of the file
- the
INDICATORSoption on the #pragma mapinc directive or the GENCSRC command. - use
indicators=ywhen opening the file
_Rindara() function for record files, before
performing I⁄O operations. If indicators are requested, and exist in the format, a 99-byte
structure definition is created. The structure definition contains
a field declaration for each indicator defined in the DDS. The name
of each field is INXX,
where XX is the DDS indicator number. The
sequence of bytes between indicators is defined as INXX_INYY, where XX is
the first undefined byte and YY is the last
undefined byte in a sequence.
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'
#pragma mapinc("example/temp","exindic/test(fmt)","indicators","")
#include "example/temp"When this DDS is included in your
ILE C/C++ program, the following structure is generated: /* ------------------------------------------------------------------ */
/* DEVICE FILE: EXINDIC/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 IN01_IN49[49]; /* UNUSED INDICATOR(S) */
char IN50;
char IN51;
char IN52_IN98[47]; /* UNUSED INDICATOR(S) */
char IN99;
}EXINDIC_TEST_FMT_indic_t;
This shows a type definition of a structure for the indicators in the format FMT of the file EXINDIC⁄TEST. The external file description contains three indicators: IN50, IN51, and IN99. The DDS keyword INDARA is also specified in the DDS for the file.
If indicators are defined for a record format and the INDICATOR option is not specified on the #pragma mapinc directive or GENCSRC command, a list of the indicators in the DDS is included as a comment in the header description.
The following shows the header description created when the
file description for the file EXINDIC⁄TEST is included in your program
and the indicators option is not specified on the #pragma mapinc directive.
/* ------------------------------------------------------------------ */
/* DEVICE FILE: EXINDIC/TEST */
/* CREATION DATE: 93/09/01 */
/* RECORD FORMAT: FMT */
/* FORMAT LEVEL IDENTIFIER: 371E00A681EA7 */
/* ------------------------------------------------------------------ */
/* INDICATORS FOR RECORD FORMAT FMT */
/* INDICATOR 50 */
/* INDICATOR 51 */
/* INDICATOR 99 */
/* ------------------------------------------------------------------ */