Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Substring notation HLASM Language Reference SC26-4940-06 |
|||||||||||||
The substring notation lets you refer to one or more characters within a character string. You can, therefore, either select characters from the string and use them for substitution or testing, or scan through a complete string, inspecting each character. By concatenating substrings with other substrings or character strings, you can rearrange and build your own strings. The substring notation can be used only in conditional assembly instructions. Table 1 shows how to use the substring notation.
The substring notation must be specified as follows:
where
the CHARACTER STRING is a character expression from
which the substring is to be extracted. The first subscript (e1)
shows the position of the first character that is to be extracted
from the character string. The second subscript (e2)
shows the number of characters to be extracted from the character
string, starting with the character indicated by the first subscript.
Thus, the second subscript specifies the length of the resulting
substring.The second subscript value of the substring notation can be specified as an asterisk (*), to indicate that all the characters beginning at the position of the first expression are used. The extracted string is equal to the length of the character expression, less the number of characters before the starting character. The character string must be a valid character expression with a length, n, in the range 1 through 1024 characters. The length of the resulting substring must be in the range 0 through 1024. The subscripts, e1 and e2, must be arithmetic expressions. When you use subscripted variable symbols in combination with substring
notation, take care to distinguish variable subscripts from substring-operation
subscripts.
|
Copyright IBM Corporation 1990, 2014
|