UNSTRING

Function

Copies portions of a string into one or more text variables.

Syntax

UNSTRING {{src_txt_lit|_var|_col}|{src_date_var|_col}}
BY {delim_txt_lit|_var|_col}
INTO dst_txt_var...

Arguments

{src_txt_lit|_var|_col}|{src_date_var|_col}

Source field to parse.

delim_txt_lit|_var|_col

Characters used to delimit the fields in {src_txt_lit|_var|_col}|{src_date_var|_col}

dst_txt_var

Destination fields to receive the results.

Description

Each substring is located using the specified delimiter. The source string must not be included in the list of destination strings.

If more destination strings than substrings are found in the source strings, the extra destination strings are each set to an empty string.

If more substrings are found in the source string than in the destination strings, the extra substrings are not processed. It is up to the programmer to ensure that enough destination strings are specified.

If the source is a date variable or column, it is converted to a string according to the following rules:

Examples

unstring $show-info by ' - ' into $name $city $state $zip
unstring $cust-data by ',' into $cust_num $entry-date $total

See Also