Using substring notation
You can select portions of a user variable by using substring notation, as shown in the following example:
The start_location and length values indicate position and count. The default start_location number is 1. If the start_location number is larger than the length of the variable, RUV substitutes a null value. Use a minus sign in the start_location value to specify a count from the end of the variable and select characters to the left by the length value. If you do not provide a length value, RUV assumes that you want to use the remainder of the string.
The following table shows examples using a job name of PRODGNL:
Notation | Result | Explanation |
---|---|---|
<PRODGNL> | PRODGNL | Default uses all characters |
<PRODGNL(3,2)> | OD | Start at third character, count 2 |
<PRODGNL(,2)> | PR | Start at first character, count 2 |
<PRODGNL(5)> | GNL | Start at fifth character |
<PRODGNL(9,3)> |
| 9 too large, null substitution |
<PRODGNL(-3)> | GNL | Go to end, move back 3 |
Related topic