Reference modification resembles the use of substringing in other computer languages. Reference modification defines a data item by specifying a starting position and length for the item.
Format >>-+-data-name-1-----------------------------------------+------> '-FUNCTION--function-name-1--+----------------------+-' | .------------. | | V | | '-(----argument-1-+--)-' >--(--leftmost-character-position--:--+--------+--)------------>< '-length-'
Must not refer to a Boolean data item.
Must not refer to an item that is defined using the TYPE clause.
For more information, see Intrinsic Functions.
For DBCS or national data items, position and length refer to the number of double byte characters.
Reference modification is generally allowed anywhere an identifier referencing an alphanumeric, DBCS, or national data item is allowed.
A data item of class date-time cannot be reference modified.
Each character of a data item referenced by data-name-1 or function-name-1 is assigned an ordinal number incrementing by one from the left-most position to the right-most position. The left-most position is assigned the ordinal number of one. If the data description entry for data-name-1 contains a SIGN IS SEPARATE clause, the sign position is assigned an ordinal number within that data item.
Reference modification creates a unique data item which is a subset of the data item referenced by data-name-1 or by function-name-1 and its arguments. This unique data item is considered an elementary item without the JUSTIFIED clause.
When data-name-1 is reference-modified, the unique data item has the same class and category as that defined for the data item referenced by data-name-1; however, if the category of data-name-1 is numeric, numeric-edited, alphanumeric-edited, or external floating-point, the unique data item has the class and category alphanumeric.
When a function is reference-modified, the unique data item has the class and category of alphanumeric, DBCS, or national depending on the function arguments.
If length is not specified, the unique data item created extends from and includes the character identified by the leftmost-character position up to and including the right-most character of the data item referenced by data-name-1 or function-name-1.