DataLoader/MX Reference Manual (H06.03+, J06.03+)

Creating a Customized Version of DataLoader/MX
DataLoader/MX Reference Manual543544-001
5-19
Sequential I/O
long long c5;
short c6[3];
} input_record;
input_record* i_r;
/*
This array holds the offset from the beginning of the
record of each field to be switched.
*/
static DTLLEN offsets[] = { offsetof( input_record, c2 ),
offsetof( input_record, c3 ),
offsetof( input_record, c5 ),
offsetof( input_record, c6[0] ),
offsetof( input_record, c6[1] ),
offsetof( input_record, c6[2] )
};
/*
This array holds the size of each of the fields to be
switched. Make sure these entries are in the same order
as in the offsets array. */
static DTLLEN sizes[] = { sizeof(i_r->c2),
sizeof(i_r->c3),
sizeof(i_r->c5),
sizeof(i_r->c6[0]),
sizeof(i_r->c6[1]),
sizeof(i_r->c6[2])
};
static long NumFields = sizeof(sizes) / sizeof(sizes[0]) ;
assert( sizeof(offsets) == sizeof(sizes) );
i_r = (input_record*) RecIn;
DTLSwitchEndian( (char*) i_r, &NumFields, offsets, sizes );
*Status = 1;
}
Sequential I/O
The DataLoader/MX file system is available to user exits and is easy to use. For
example, to open a file, call DTLOpen with the name of the file. DTLOpen returns a file
number that is passed to the other routines for accessing the file. The DataLoader/MX
file number is different from a OSS file descriptor or Guardian file number.
DTLClose
This procedure closes a file previously opened by DTLOpen. Files opened by the
DataLoader/MX file system that are still open when DataLoader/MX performs a normal
termination are closed by DataLoader/MX.
The syntax is:
void DTLClose( short FileNum );