Usage

The base.Channel class is a built-in class providing basic input/output functionality for:
Important: No character set conversion is done when reading or writing data with channel objects. The character set used in the data file must correspond to the locale of the runtime system, for both input and output.
Steps to use a channel object:

Channel methods may raise exceptions. Exceptions can be trapped with the WHENEVER ERROR or TRY/CATCH instructions.

When reading or writing strings, the escape character is the backslash (\).

The are three modes to read and write data with Channels:

  1. Reading/writing formatted data as a set of fields in a line (i.e. records), with the read() and write() methods, needing a value separator defined by setDelimiter(). This mode follows the same formatting rules as the LOAD/UNLOAD instructions, and can also be used to read/write CSV (Comma Separated Value) formatted data.
  2. Reading/writing complete lines with the readLine() and writeLine() methods. This mode is typically used to read/write simple data files.
  3. Handling raw character string data by reading/writing pieces of strings, with the readOctets() and writeNoNL() methods.