### CONV READ/WRITE Overview

The 'read' part describes how input data should be handled, whereas the 'write' part describes how to write the data which strongly depends on how it was read.

#### READ

- RECORD
  - FIX, read records with a fixed length
  - VARIABLE, e.g. record starts with length field
  - DELIM, record ends with defined delimiter (like READ.TEXT but just one delimiter is defined)
  - Character conversion, if CCSID is set, else binary handling
  - Records as output
- TEXT
  - Record length is ignored/lost
  - Text is split at delimiters (all usual text delimiters) and separated into a record and a rest portion (trailing whitespace + delimiter)
  - Automatic character conversion
  - Records as output
- CHAR
  - Record length is ignored/lost
  - Reads all characters, delimiters are also part of the data
  - Automatic character conversion
  - Blocks as output (block handling)
- BIN
  - Record length is ignored/lost
  - Reads all bytes as is
  - Blocks as output (block handling)

#### WRITE

READ / WRITE | RECORD | TEXT
--- | --- | ---
RECORD | FIX, write with fixed length VARIABLE, e.g. write with length fields Character conversion only if CCSID is set If printable characters Else binary handling | Read records are complemented with a delimiter Non Host files e.g. USS Definition of own delimiter is possible Automatic character conversion
TEXT | Read text records are written (rest portion is dropped) Usually VB Other record formats also possible Padding on FIX records Automatic character conversion | Read text records are written (rest portion is dropped) Supplemented with system delimiter Definition of own delimiter is allowed Automatic character conversion
CHAR | Usually not useful! Read blocks are cut into records Default: VB with n records and smaller rest at the end Automatic character conversion | !!! ERROR !!!
BIN | Usually not useful! Read blocks are cut into records Default: VB with n records and smaller rest at the end Automatic character conversion, if required | !!! ERROR !!!

READ / WRITE | CHAR | BIN
--- | --- | ---
RECORD | Records are concatenated Automatic character conversion No delimiter supplement | Records are concatenated Binary handling
TEXT | Read text records are written with original delimiters Automatic character conversion | Keep internal representation (UTF-8) of text Read text records are written with original delimiters
CHAR | Automatic character conversion | Keep internal representation (UTF-8) of text
BIN | Read data is assumed to be in local charset Writes character blocks Possibly character conversion | Read binary blocks will be written