Split Record

Filter:

SPLIT

Syntax:

SPLIT [MIN recordsize] displacement expression 'STR' target [numreps]

Operands:

recordsize :: integer length of minimum new records size
displacement :: is the relative displacement, in number of columns, from the target to the position in the record where the split is made.
expression :: AT | BEFORE | AFTER
target :: delimiter character_string delimiter
delimiter :: any non-blank delimiting character not appearing in the string
numreps :: maximum number of splits/input_record.

Functional Description:

Use the SPLIT stage to split records into multiple records. SPLIT reads records from its primary input stream, splits the records, and writes the resulting records to its primary output stream, if it is connected. If no operands are specified, SPLIT divides the records at blank characters and discards the blanks.

Records are split relative to occurrences of a specified target. The target can be a range of characters, a list of characters, or a character string.

You can specify the number of characters to skip before SPLIT begins looking for the target . You can also specify that the records be split at, before, or after a target. If you specify that the records are to be split before or after the target, the split can be made at a specified displacement before or after the target.

* disp and BEFORE, a split occurs before the column that is disp columns to the left of the target

* disp and AFTER, a split occurs after the column that is disp columns to the right of the target

* -disp and BEFORE, a split occurs before the column that is disp columns to the right of the target

* -disp and AFTER, a split occurs after the column that is disp columns to the left of the target.

AT causes the input records to be split at the specified target. The target characters are discarded. AT is the default.

BEFORE
causes input records to be split before the target. The target characters are retained.

AFTER
causes input records to be split after the target. The target characters are retained.

If you specify AFTER with STRING, the records are split after any columns that contain the last character of string.

Hhexstring and Xhexstring:
defines a target string of hexadecimal characters, following the X or H, that defines a target string of characters to be located. The X or H can be specified in uppercase or lowercase. You must not specify any spaces in the string. There must be an even number of hexadecimal characters in the string.

Secondary Input/Output:

NONE

Synonyms:

none

Usage Notes:

The following example will split all records with at the "." from the input stream into a multiple records.

SPLIT 0 AT STR /./

The following example will split records 2 columns after the occurence of string "ABC".

SPLIT 2 after STR /ABC/

The following example will split all record after a SPACE.

SPLIT * STR / /


JAVA Pipelines

Cullen Programming logo