On Tue, 8 Sep 2020 02:30:01 +0100, CM Poncelet wrote:
>
>My mistake was to think that setting a variable to a quoted value, in
>REXX, made that variable a type CHAR. But REXX considers it to be NUM if
>it contains only numerics, regardless of whether its set value was
>
Not only numerics. For example, DATATYPE( '-1.2E+3' ) is NUM even
though it contains 4 nonnumerics.
>quoted or not. The oddity is that '00000001'b etc. has DATATYPE CHAR
>
Quoting is a matter of representation, not of value. For example,
A=='A' is true because the values are identical.
>instead of NUM in REXX. This would not happen in Fortran (type logical)
>or PL/I (DCL bit) or even COBOL (level-77 or -88, whatever it is).
>
Are you just learning that not all languages are the same? Rexx
doesn't even have a level-77.
But see:
https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.ikja300/datatyp.htm
Hmm. There I read:
The DATATYPE function tests the meaning or type of characters in a string,
independent of the encoding of those characters (for example, ASCII or
EBCDIC).
What is that trying to say? Does it mean that DATATYPE( '31'x ) (ASCII '1')
and DATATYPE( 'F1'x ) (EBCDIC 1) are both NUM?
(If they recognize DBCS, they should also recognize the prevalent UTF-8.)
>On 07/09/2020 06:52, Seymour J Metz wrote:
>> It isn't boolean; everything in REXX is a character string.
>>
What he said.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN