g (group extract) processing code

The g processing code extracts one or more groups of contiguous character substrings delimited by the specified character.

System Processors Select, Update, List
Code Type Attribute Defining
Dictionary Attributes Input Conversion, Output Conversion, Correlative

Syntax

g{skip.segments} delimiter get.segments
Note: The implied spaces between the arguments in the syntax definition are for visual clarity only and are not allowed.

Parameter(s)

skip.segments Specifies the number of delimited groups to skip before performing the extraction. If omitted, zero is assumed, and extraction occurs from the beginning of the value.
delimiter Any single printable character excluding integers and these characters:
_ segment mark (SM)
^ attribute mark (AM)
] value mark (VM)
\ subvalue mark (SVM)
get.segments Specifies the number of contiguous groups to extract from the value.

Example(s)

The example below illustrates the results obtained from various combinations of the g code if the value being processed was the string:

ca*92714*1000
g*1   ca
g0*1  ca
g*3   ca*92714*1000
g1*2  92714*1000
g2*1  1000
g2*2  1000
g3*1  (null)