Domain: String functions
The SUBLIST( ) function returns the contents of the selected element of an SDF list. An SDF list is a string which is interpreted in accordance with the syntactical rules for operand lists in commands. Evaluation of the string with this function is meaningful only if it has the format ’(<element1>,<element2>,...<elementn>)’, where <element> is a sequence of icharacters which contain no commas outside pairs of parentheses.
The IS-SDF-LIST( ) function can be used to check whether a string is a list.
Format
SUBLIST( ) |
LIST = string_expression ,POSITION = arithm_expression |
Result type
STRING
Input parameters
LIST = string_expression
Designates an SDF list.
POSITION =
Designates the element of the SDF list whose contents are to be output.
POSITION = arithm_expression
Designates an element of an SDF list with its element number.
“arithm_expression” must be a valid element number.
Result
The contents of the element in the form of a string.
Error messages
SDP0411 STRING EMPTY SDP0447 THE GIVEN STRING IS NOT A SDF-LIST SDP0448 THE PARAMETER “POSITION” OUT OF RANGE
Example
/A = SUBLIST('(abc,def,jkl,uvw)',3) /SHOW-VARIABLE A A = jkl