Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
C2D (Character to Decimal) z/OS TSO/E REXX Reference SA32-0972-00 |
|
>>-C2D(string--+----+--)--------------------------------------->< '-,n-' returns the decimal value of the binary representation of string. If the result cannot be expressed as a whole number, an error results. That is, the result must not have more digits than the current setting of NUMERIC DIGITS. If string is null, returns 0. Here are some examples:
If you specify n, the string is taken as a signed number expressed in n characters. The number is positive if the leftmost bit is off, and negative, in two's complement notation, if the leftmost bit is on. In both cases, it is converted to a whole number, which may, therefore, be negative. The string is padded on the left with '00'x characters (note, not “sign-extended”), or truncated on the left to n characters. This padding or truncation is as though RIGHT(string,n,'00'x) had been processed. If n is 0, C2D always returns 0. If you do not specify n, string is processed as an unsigned binary number. Here are some examples:
Implementation maximum: The input string cannot have more than 250 characters that are significant in forming the final result. Leading sign characters ('00'x and 'FF'x) do not count toward this total. |
Copyright IBM Corporation 1990, 2014
|