DataLoader/MX Reference Manual (G06.24+)

Creating a Customized Version of DataLoader/MX
DataLoader/MX Reference Manual525872-002
5-20
Sequential I/O
$
\
=
/G
/E
Otherwise, it is handled as an OSS file.
The file is opened for either read or write access, depending upon AccessMode. If the
string pointed to by AccessMode is an uppercase or lowercase letter r, the file is
opened for read access. If the string pointed to by AccessMode is an uppercase or
lowercase letter w, the file is opened for write access. This string must be
null-terminated.
The value returned by this procedure is a positive integer, referred to in
DataLoader/MX as FileNum, that is used to identify this open in all subsequent calls
to DataLoader/MX sequential I/O procedures. FileNum is not the same as the OSS
file descriptor or Guardian file number.
FileNum -1 indicates the file specified by the -I= parameter (not standard input).
FileNum -2 indicates the file specified by the -O= parameter (not standard output).
File numbers are used for DTLRead and DTLWrite procedures only.
There are no error returns. Errors are handled by DataLoader/MX.
DTLRead
This procedure reads a record up to MaxLen bytes from the file FileNum and places
those bytes into the buffer pointed to by Buf.
The syntax is:
If FileNum is -1, this procedure reads from the file specified in the -I= parameter.
The value returned by this procedure is the actual number of bytes read with a value of
-1 indicating EOF.
There are no error returns. Errors are handled by DataLoader/MX.
DTLWrite
This procedure writes up to Len bytes from the buffer pointed to by Buf to the file
FileNum.
The syntax is:
If FileNum is -2, the data is written to the file specified in the -O= parameter.
long DTLRead( short FileNum, char* Buf, long MaxLen );
long DTLWrite( short FileNum, char* Buf, long Len );