#### TXT

#### Synopsis

    HELP:   Format elements as text data with delimiters
    TYPE:   OBJECT
    SYNTAX: TXT(METHOD=HOST/BIN/REC/TXT/NL/USS/LF/UNIX/CR/OLDMAC/CRLF/WINDOWS/DLM/SYSTEM/ORIGINAL,CHRSET=NONE/SYSTEM/ASCII/UCS1/UTF8/EBCDIC/UCS2BE/UTF16BE/UCS2LE/UTF16LE/UCS4BE/UTF32BE/UCS4LE/UTF32LE/LOCAL,RPLTAB/RPLHTB[=num],RPLVTB[=num],RPLBSP,RPLCTR=SPACE/SUBSTITUTE/DELETE,SUPTWS,BUFSIZ=num,INICNT=num,REGEXP())

#### Description

The object "format text" formats text elements into text records with a certain delimiter, no delimiter (mainly useful for record-oriented systems) or produces the original data (concatenate the text element with the corresponding rest element).

To add the delimiter in the correct encoding the charset must be known and can be defined. But normally the charset is already known through the read operation and it is not required to specify this value.

You can replace horizontal and vertical tabs by whitespace characters and new records so that the data looks like it was printed. Additionally, all remaining control characters can be suppressed or replaced by whitespace or the substitution character. This features are useful to convert text data containing tabs and other control characters for host data sets.

The method ORIGINAL uses the original delimiter that is present in the input data. If the option suppress trailing whitespace is used, then all whitespace characters in front of the original delimiter are removed.

Regular expressions can be used to validate text records or perform replacements to manipulate text records.

Text formatting supports a lot of powerful features which can be accessed with the parameters below.

#### Arguments

- `NUMBER: METHOD=HOST/BIN/REC/TXT/NL/USS/LF/UNIX/CR/OLDMAC/CRLF/WINDOWS/DLM/SYSTEM/ORIGINAL - Method for text formatting [DEFAULT]`
  - `HOST - Adds no delimiter (HOST)`
  - `BIN - Adds no delimiter (HOST)`
  - `REC - Adds no delimiter (HOST)`
  - `TXT - Adds the system specific delimiter (DEFAULT)`
  - `NL - Adds delimiter new line (USS)`
  - `USS - Adds delimiter for USS (new line)`
  - `LF - Adds delimiter line feed (UNIX)`
  - `UNIX - Adds delimiter for UNIX (line feed)`
  - `CR - Adds delimiter carriage return (MAC)`
  - `OLDMAC - Adds delimiter for old MACs (carriage return)`
  - `CRLF - Adds delimiter carriage return line feed (WIN)`
  - `WINDOWS - Adds delimiter for WINDOWS (carriage return line feed)`
  - `DLM - Adds the system specific delimiter (DEFAULT)`
  - `SYSTEM - Adds the system specific delimiter (DEFAULT)`
  - `ORIGINAL - Adds the original data at the end of a line (only for band FMT)`
- `NUMBER: CHRSET=NONE/SYSTEM/ASCII/UCS1/UTF8/EBCDIC/UCS2BE/UTF16BE/UCS2LE/UTF16LE/UCS4BE/UTF32BE/UCS4LE/UTF32LE/LOCAL - Character set [auto]`
  - `NONE - No character set defined`
  - `SYSTEM - SYSTEM (environment specific (on mainframe EBCDIC else ASCII))`
  - `ASCII - ASCII (mainly used in the for open system)`
  - `UCS1 - UCS-1 (for text formatting identical to ASCII < 64k)`
  - `UTF8 - UTF-8 (for text formatting identical to ASCII < 2M)`
  - `EBCDIC - EBCDIC (mainly used on IBM mainframe)`
  - `UCS2BE - UCS-2 Big Endian (multibyte character set < 64k)`
  - `UTF16BE - UTF-16 Big Endian (multibyte character set < 2M)`
  - `UCS2LE - UCS-2 Little Endian (multibyte character set < 64k)`
  - `UTF16LE - UTF-16 Little Endian (multibyte character set < 2M)`
  - `UCS4BE - UCS-4 Big Endian (multibyte character set < 64k)`
  - `UTF32BE - UTF-32 Big Endian (multibyte character set < 2M)`
  - `UCS4LE - UCS-4 Little Endian (multibyte character set < 64k)`
  - `UTF32LE - UTF-32 Little Endian (multibyte character set < 2M)`
  - `LOCAL - LOCAL (platform specific (on mainframe EBCDIC else ASCII))`
- `NUMBER: RPLTAB/RPLHTB=num - Replace horizontal tabulators by spaces using this tab width [0 - no replacement]`
- `NUMBER: RPLVTB=num - Replace vertical tabulators by new lines using this tab width [0 = no replacement]`
- `SWITCH: RPLBSP - Replace backspace (deletes the backspace and the byte before) [FALSE]`
- `NUMBER: RPLCTR=SPACE/SUBSTITUTE/DELETE - Replace remaining control characters [NONE]`
  - `SPACE - Replace control characters with whitespace character (0x20/0x40)`
  - `SUBSTITUTE - Replace control characters with substitution character (0x1A/0x3F)`
  - `DELETE - Remove control characters`
- `SWITCH: SUPTWS - Suppress trailing whitespaces [FALSE]`
- `NUMBER: BUFSIZ=num - Initial buffer size for preallocation [65536]`
- `NUMBER: INICNT=num - Initial amount of records for preallocation [128]`