Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
SETC variables in arithmetic expressions HLASM Language Reference SC26-4940-06 |
|
The assembler permits a SETC variable to be used as a term in an arithmetic expression if the character string value of the variable is a self-defining term. The value represented by the string is assigned to the arithmetic term. A null string is treated as zero. Examples:
In evaluating the arithmetic expression in the fifth statement, the first term, &C(1), is assigned the binary value 101 (decimal 5). To that is added the value represented by the EBCDIC character A (hexadecimal C1, which corresponds to decimal 193). Then the value represented by the third term &C(3) is subtracted, and the value of &A becomes 5+193-23=175. This feature lets you associate numeric values with EBCDIC or hexadecimal characters to be used in such applications as indexing, code conversion, translation, and sorting. Assume that &X is a character string with the value ABC.
The first statement sets &I to C'A'. The second statement extracts the 193rd element of &TRANS (C'A' = X'C1' = 193). The following code converts a hexadecimal value in &H into
a decimal value in &VAL:
The following code converts the double-byte character Da into
a decimal value in &VAL. &VAL can then
be used to find an alternative code in a subscripted SETC variable:
Although you can use a predefined absolute symbol as an operand
in a SETA expression, you cannot substitute a SETC variable whose
value is the same as the symbol. For example:
|
Copyright IBM Corporation 1990, 2014
|