No. REXX has built in functions to test the value of a string, but it's all 
strings

foo =01
bar = '01'
baz = 0||1

all yield the same value,

shmuel@linux-gn5l:~> rexxtry
  /usr/local/bin/rexxtry lets you interactively try REXX statements.
    Each string is executed when you hit Enter.
      Enter 'call tell' for a description of the features.
  Go on - try a few...             Enter 'exit' to end.
say datatype(01)
NUM
  .................................... /usr/local/bin/rexxtry on LINUX
say datatype('01')
NUM
  .................................... /usr/local/bin/rexxtry on LINUX
say datatype(0||1)
NUM






--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


________________________________________
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf of CM 
Poncelet <ponce...@bcs.org.uk>
Sent: Monday, September 7, 2020 9:30 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

No, REXX has both DATATYPE CHAR and NUM strings.

Meanwhile C2D, D2X etc. would be useless if REXX could not then process
binary data - as in IPCS REXX:
ADDRESS IPCS
PSA_ADDRESS = '00000000'
"EVALUATE" PSA_ADDRESS||. ,
  "POSITION("X2D(224)") LENGTH(4) REXX(STORAGE(OLD_ASCB_ADDRESS))"
"EVALUATE" OLD_ASCB_ADDRESS||. ,
  "POSITION("X2D(6C)") LENGTH(4) REXX(STORAGE(OLD_ASXB_ADDRESS))"
"EVALUATE" OLD_ASXB_ADDRESS||. ,
  "POSITION("X2D(4)") LENGTH(4) REXX(STORAGE(TCB_CHAIN_START_ADDRESS))"
"EVALUATE" OLD_ASXB_ADDRESS||. ,
  "POSITION("X2D(8)") LENGTH(4) REXX(STORAGE(TCB_CHAIN_STOP_ADDRESS))"
<etc.>

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
quoted or not. The oddity is that '00000001'b etc. has DATATYPE CHAR
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).



On 07/09/2020 06:52, Seymour J Metz wrote:
> It isn't boolean; everything in REXX is a character string.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> ________________________________________
> From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf of 
> CM Poncelet <ponce...@bcs.org.uk>
> Sent: Monday, September 7, 2020 1:30 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> "ELSE IF ¬TRUE THEN <whatever else>" was just to demonstrate that "TRUE" is 
> Boolean.
>
>
>
> On 07/09/2020 05:24, Seymour J Metz wrote:
>> First, that code is highly obfuscated. Why would you ever want to write "IF 
>> foo & TRUE" instead of "IF foo"?
>>
>> Second, "ELSE IF ¬TRUE THEN foo" is dead code.
>>
>> Third, there are no booleans in REXX; the only data type is character string.
>>
>>
>> --
>> Shmuel (Seymour J.) Metz
>> http://mason.gmu.edu/~smetz3
>>
>>
>> ________________________________________
>> From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf of 
>> CM Poncelet <ponce...@bcs.org.uk>
>> Sent: Sunday, September 6, 2020 9:31 PM
>> To: IBM-MAIN@LISTSERV.UA.EDU
>> Subject: Re: REXX true/false (was Constant Identifiers)
>>
>> In the following example,
>> TRUE = (1 - 1 = 0 & 1 ¬= 0) [or whatever is more appropriate],
>> it is then sufficient e.g. to code:
>> IF 4 ¬= 6 & TRUE THEN <whatever>
>> ELSE IF ¬TRUE THEN <whatever else>
>>
>> I.e. TRUE can be defined as a Boolean '1'b in REXX, as per above.
>>
>> On 06/09/2020 20:43, Paul Gilmartin wrote:
>>> On Sun, 6 Sep 2020 12:03:18 -0400, scott Ford wrote:
>>>
>>>> I have done things like true =‘Y’ and then
>>>>
>>>> If true
>>>>  ..........
>>>> end
>>>>
>>> What language?  That would certainly be a syntax error in Rexx.
>>> And why?  You could just omit the "if true" and code:
>>>     do
>>>         ..........
>>>     end
>>>
>>>
>>> n Sun, 6 Sep 2020 17:39:48 +0000, Seymour J Metz wrote:
>>>> A simple true=1;false=0 should suffice for clarity.
>>>>
>>> Perhaps not to someone most familiar with shell scripts
>>> where the definitions are nearly the opposite (command
>>> status ($?) = 0 means success or true).
>>>
>>>
>>> On Sun, 6 Sep 2020 17:43:04 +0100, Rupert Reynolds wrote:
>>>> The advantage of Boolean is clarity in something like:-
>>>> /* Rexx */
>>>> TRUE = (1=1)
>>>> ...
>>>> SELECT
>>>>  WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord) THEN do
>>>>    ...
>>> Continuing your example, how would you have set the variables
>>> "GotASCII" and "GotVBMrecord" using the quasi-constants TRUE
>>> and FALSE?  Does that enhance either clarity or economy of
>>> expression?
>>>
>>> I'm thinking that something like:
>>>     if filetype=='ASCII' then GotASCII = TRUE; else GotASCII = FALSE
>>> would more succinctly be written:
>>>     GotASCII = ( filetype=='ASCII' )
>>>
>>> But I've seen even worse, such as:
>>>     if  GotASCII = true then ...
>>> rather than simply:
>>>     if  GotASCII then ...
>>>
>>>
>>> On Sun, 6 Sep 2020 19:28:11 +0000, Seymour J Metz wrote:
>>>> Yes, you can count on the truth values of 0 and 1 in REXX never changing.
>>>>
>>> Only if I spent $60 for the ANSI Standard .pdf
>>>
>>> -- gil
>>>
>>> ----------------------------------------------------------------------
>>> For IBM-MAIN subscribe / signoff / archive access instructions,
>>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>> .
>>>
>> ----------------------------------------------------------------------
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>
>> ----------------------------------------------------------------------
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>> .
>>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to