Dataloader/MP Reference Manual

Table Of Contents
Creating a Customized Version of DataLoader/MP
DataLoader/MP Reference Manual424148-003
5-19
Sequential I/O
*/
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
DataLoader/MP’s file system is available to user exits and is quite straightforward. 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. DataLoader/MP’s file
number is different from a Guardian file number.
DTLClose
This procedure closes a file previously opened by DTLOpen. Any files opened by
DataLoader/MP’s file system that are still open when DataLoader/MP performs a
normal termination are closed by DataLoader/MP.
The syntax for this procedure follows:
DTLOpen
This procedure opens the file whose name, together with any requested features, is
pointed to by Name.
The syntax for this procedure follows:
void DTLClose( short FileNum );
short DTLOpen( char* Name, char* AccessMode );