Have you ever heard of PL/I? Much of the syntax of REXX derives from PL/I, and it has two different string types: CHARACTER and BIT.
With regard to the built in functions, you are once again confusing the type of a variable with its contents. Would you argue that +1 in -1 are different data types because one is a valid input to sqrt and the other is not? -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List <[email protected]> on behalf of CM Poncelet <[email protected]> Sent: Tuesday, September 8, 2020 7:53 PM To: [email protected] Subject: Re: REXX true/false (was Constant Identifiers) Mr Bridges, 1) The reason the program does not abend is it has a "SIGNAL ON SYNTAX NAME ERROR3" coded before the "IF TRUE THEN...", which traps the abend and resumes execution at label ERROR3. 2) I disagree with Mr Metz on the grounds that he argues that "everything in REXX is a character string" - upon which I then implicitly ask, "What is a non-character string and in what 3GL, 2GL, 1GL language (but not 0GL, as that would be microcode) do such non-character strings exist that do not exist in REXX?" It has nothing to do with EBCDIC and ASCII. It is that REXX supports all binary strings - as in the REXX functions C2D, C2X, D2X, X2B, B2X, BITAND, BITOR, BITXOR etc. and as applied in reading/processing unformatted 'raw' system dumps. To argue that "everything in REXX is a character string"is meaningless. It might be appropriate to argue that "everything in REXX is a binary string", as that would include "character string" - or even "everything in REXX is a string", because that would be sufficient in itself and would not constrain all REXX strings to have to be "character" ones. As I said, REXX supports all binary strings - not only "character" ones. Not sure whether that answers your questions, but I hope it does. Cheers, Chris Poncelet (retired sysprog) On 08/09/2020 16:27, Bob Bridges wrote: > Mr Poncelet, I'm interested in this example. Two questions: > > 1) Once TRUE is set to a '1'b in the last two sections, why does the program > not abend when it encounters "IF TRUE THEN..."? Seems to me REXX should > complain that TRUE is not 1 or 0. > > 2) From your preceding posts I got the impression you were disagreeing with > Mr Metz, that you believed REXX represented data in other forms that EBCDIC > character strings. (EBCDIC in TSO REXX, that is; I'm not concerned with > ASCII platforms here.) But your example seems to support his assertion. > Did I misunderstand you? What am I missing? > > --- > Bob Bridges, [email protected], cell 336 382-7313 > > /* This is how sin happens. We don't set out to do something very wrong. We > make up stories that sound good to ourselves about how the thing really > isn't that wrong, or how it really isn't anybody else's business. / Before > we lie to others, we lie to ourselves. Do that, and it can be hard to find > the truth again, even when it is obvious nothing but the truth will do. > -Maggie Gallagher, 2001-08-27 */ > > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[email protected]] On > Behalf Of CM Poncelet > Sent: Monday, September 7, 2020 22:33 > > You said, "It isn't boolean; everything in REXX is a character string." > > I agree that "it's all strings", but not that "everything in REXX is a > *character* string." > > Try the following: > > ARG DEBUG > IF ABBREV(DEBUG,D,1) THEN , > TRACE I > > SIGNAL ON SYNTAX NAME ERROR0 > TRUE = 1 > SAY 'TRUE NUMERIC = 'TRUE > SAY 'DATATYPE TRUE = 'DATATYPE(TRUE) > IF ¬TRUE THEN SAY 'NOT TRUE NUMERIC' > IF TRUE THEN SAY 'YES, TRUE NUMERIC' > > ERROR0: > SIGNAL ON SYNTAX NAME ERROR1 > TRUE = '1' > SAY 'TRUE CHARACTER = 'TRUE > SAY 'DATATYPE TRUE = 'DATATYPE(TRUE) > IF ¬TRUE THEN SAY 'NOT TRUE CHARACTER' > IF TRUE THEN SAY 'YES, TRUE CHARACTER' > > ERROR1: > SIGNAL ON SYNTAX NAME ERROR2 > TRUE = '31'X > SAY 'TRUE HEXADECIMAL = 'TRUE > SAY 'DATATYPE TRUE = 'DATATYPE(TRUE) > IF ¬TRUE THEN SAY 'NOT TRUE HEXADECIMAL' > IF TRUE THEN SAY 'YES, TRUE HEXADECIMAL' > > TRUE = '00110001'B > SAY 'TRUE BINARY HEX = 'TRUE > SAY 'DATATYPE TRUE = 'DATATYPE(TRUE) > IF ¬TRUE THEN SAY 'NOT TRUE BINARY HEX' > IF TRUE THEN SAY 'YES, TRUE BINARY HEX' > > TRUE = '00000001'B > SAY 'TRUE BINARY ONLY = 'TRUE > SAY 'DATATYPE TRUE = 'DATATYPE(TRUE) > IF ¬TRUE THEN SAY 'NOT TRUE BINARY ONLY' > IF TRUE THEN SAY 'YES, TRUE BINARY ONLY' > > ERROR2: > SIGNAL ON SYNTAX NAME ERROR3 > TRUE = '1'B > SAY 'TRUE BINARY BIT = 'TRUE > SAY 'DATATYPE TRUE = 'DATATYPE(TRUE) > IF ¬TRUE THEN SAY 'NOT TRUE BINARY BIT' > IF TRUE THEN SAY 'YES, TRUE BINARY BIT' > > ERROR3: > EXIT 0 > > > ... which produces output: > > TRUE NUMERIC = 1 > DATATYPE TRUE = NUM > YES, TRUE NUMERIC > TRUE CHARACTER = 1 > DATATYPE TRUE = NUM > YES, TRUE CHARACTER > TRUE HEXADECIMAL = 1 > DATATYPE TRUE = NUM > YES, TRUE HEXADECIMAL > TRUE BINARY HEX = 1 > DATATYPE TRUE = NUM > YES, TRUE BINARY HEX > TRUE BINARY ONLY = ? <-- > DATATYPE TRUE = CHAR <-- > TRUE BINARY BIT = ? <-- > DATATYPE TRUE = CHAR <-- > > PRESS ANY KEY TO CONTINUE. > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > . > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
