VSLICE() |
|
|
The VSLICE() function returns a string formed by extracting a given value or subvalue position from a dynamic array.
Format
VSLICE(string, vpos) VSLICE(string, vpos, svpos)
where
The first form of the VSLICE() function processes string to build a new dynamic array containing only the specified value position from each field. Subvalues are returned as part of each value in the result string.
The second form processes string to build a new dynamic array containing only the specified subvalue position from each field. If vpos is less than one, the subvalue is extracted from all value positions and value marks are included in the returned string to match the structure of the original data. If vpos is one or greater, the subvalue is extracted only from the specified value position and no value marks are included in the result.
If vpos and svpos are both less than one, the VSLICE() function returns the source string.
Examples
The following examples are all based on a string that contains 1FM2VM3SM4VM5FM6VM7SM8VM9
VSLICE(S, 0, 3)
VSLICE(S, 1, 2)
VSLICE(S, 2, 3)
VSLICE(S, 3, 2) |