IBM Books

Reference

Flat File Interface Delimiters

In order to improve performance, you can keep the Net.Data tabular output from a series of SQL requests in a flat file. You can retrieve the flat file in subsequent requests, instead of re-issuing the SQL requests.

Net.Data flat files can be created from Net.Data tables and Net.Data tables can be built from flat files. In order to make the transformations between the tables and flat files, you must define the mapping between columns in a table and records in a flat file. A delimiter is a flag or separator that FFI uses when dividing the file into parts (such as columns of a row) according to the requested transform. Delimiters provide a method for defining how portions of records in a flat file can be separated and mapped to columns in a table, and how columns in a table can be mapped to records in a flat file.

There are two types of delimiters:

New-line character (ASCIITEXT)
Use this transformation when your table is made up of one column. Net.Data maps each record in the corresponding flat file onto a single row in the table. In this case, the regular new-line character which separates records in the flat file is the only delimiter used.

New-line character and delimiter string (DELIMITED)
Use this transformation when your table is made up of multiple columns. When Net.Data creates a flat file record from a row in a table, it places the delimiter string as a separator between the items. When Net.Data rebuilds a table from a flat file, it uses the delimiter string to determine how much of each row to place in a column of the table. In this case, the regular new-line character separates the records in the flat file that correspond to rows in the table, and the delimiter string separates the items within a single record.

For read operations, the delimiter separates the contents of the file into rows and columns of a table. For write operations, the delimiter indicates the end of a value in a table row and column. Net.Data passes the delimiter to the FFI as a Net.Data macro string and does not include a null character at the end of the characters unless explicitly listed in the DELIMITER parameter.

To use the null character in the delimiter, specify the DELIMITER parameter as a slash and a zero in double quotes, "\0", instead of an empty string by using two double quotes, """". If you specify the ASCIITEXT transform, Net.Data uses the new-line character as the delimiter and ignores any requested delimiter.

Undesirable changes to a file can occur if you use a different delimiter for write operations than for read operations. Net.Data writes the file with the new delimiter.

The maximum length of a delimiter is 256 characters.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]