[USflag] The American Programmer [USflag]


Home
Books on Mainframe Programming
Mainframe Manuals and Tutorials
System Abend codes, Sqlcodes, VSAM/QSAM codes
Everything about the IBM AS/400 Midrange Computer - iSeries
Everything about CICS
Everything about COBOL
Everything about DB2 and SQL
Everything about IMS
Everything about Java and JavaScript
Everything about JCL and JES
Everything about REXX
  Sorting in REXX: The Bubble Sort
  REXX Password Generator
  Using REXX to capture displayed output of TSO command
  Count records in REXX
  REXX program to calculate present value of money
  REXX function to format a number in currency format
  REXX function to produce a fixed-length number
  REXX program to produce lottery numbers
  REXX: what does your phone number spell?
  REXX Practice Problems.
  Just Enough REXX Tutorial
  Setting up to Execute REXX Programs on TSO/ISPF
  How to execute a REXX program
  REXX Boolean operators
  Comparison of CLIST language and REXX
  REXX Comparison operators
  REXX Debugging: the TRACE verb
  Using REXX OUTTRAP
  Reserved REXX Variables
  Executing REXX through JCL.
  Writing ISPF Edit Macros in REXX
  REXX program to unload a PDS
  REXX book: The REXX Language on TSO
  REXX Functions Book
  QMF Procedures Written in REXX
  Using REXX Subroutines with the QMF Calc panel
  REXX error codes (RC)
  REXX programming language manuals
  Books on REXX programming
  The REXX Files
Everything about zOS, VSAM, Tivoli, Assembler
Everything about TSO, ISPF, Spufi
Site Map and Site Search

           Home   > REXX   > REXX: Comparison Operators

REXX Comparison operators

How do you say equal, not equal, greater than, less than in REXX?
REXX IF

Comparison operators

=	Equal.  If numeric, when compared algebraically.  (1.0 is equal to 001.000.)  
   If not numeric, when padded with leading or trailing spaces.  ("Sue" is equal to "   Sue   ".)  
   Case is significant: "SUE" is not equal to "sue".

<>	Not equal, the negation of "=".  Algebraic comparison and padding are performed.

><	Not equal, the negation of "=".  Algebraic comparison and padding are performed.

\=	Not equal, the negation of "=".  Algebraic comparison and padding are performed.

=	Not equal, the negation of "=".  (The symbol "" may not be found on all keyboards.)  
   Algebraic comparison and padding are performed.

^=	Not equal, the negation of "=".  (The symbol "^" may not be found on all keyboards.)  
   Algebraic comparison and padding are performed.

>	Greater than.  Algebraic comparison and padding are performed.

<	Less than.  Algebraic comparison and padding are performed.

>=	Greater than or equal to.  Algebraic comparison and padding are performed.

<	Not less than.  (The symbol "" may not be found on all keyboards.)  
   Algebraic comparison and padding are performed.

\<	Not less than.  Algebraic comparison and padding are performed.

<=	Less than or equal to.  Algebraic comparison and padding are performed.

>	Not greater than.  (The symbol "" may not be found on all keyboards.)  
   Algebraic comparison and padding are performed.

\>	Not greater than.  Algebraic comparison and padding are performed.
==	Strictly equal on a character-by-character basis.  No algebraic comparison or padding is done.
	
==	Strictly not equal, the negation of "==".  (The symbol "" may not be found on all keyboards.)  
   No algebraic comparison or padding is done.

\==	Strictly not equal, the negation of "==".  No algebraic comparison or padding is done.

>>	Strictly greater than.  No algebraic comparison or padding is done.

>>=	Strictly greater than or equal to.  No algebraic comparison or padding is done.

<<	Strictly less than.  No algebraic comparison or padding is done.

<<=	Strictly less than or equal to.  No algebraic comparison or padding is done.

>>	Strictly not greater than.  (The symbol "" may not be found on all keyboards.)  
   No algebraic comparison or padding is done.

<<	Strictly not less than.  (The symbol "" may not be found on all keyboards.)  
   No algebraic comparison or padding is done.

&	And.  The conditions on both sides of this operator must be true. 

|	Or.  One or both of the conditions on either side of this operator must be true. 

&&	Exclusive Or.  Only one, but not both, of the conditions on either side of this operator must be true. 




The difference between = and ==
= Equal = asks if two things are equal, accounting for leading/trailing spaces and numeric equivalency. IF "JOE" = "JOE " THEN SAY "YES" /* they are equal */ IF 100 = 0100.00 THEN SAY "YES" /* they are equal */ == Strictly Equal == asks if two things are exactly equal, on a character by character basis IF "JOE" == "JOE " THEN SAY "YES" /* they are not equal */ IF 100 == 0100.00 THEN SAY "YES" /* they are not equal */ IF "JOE" == "JOE" THEN SAY "YES" /* they are equal */ IF 100 == 100 THEN SAY "YES" /* they are equal */ The same principle applies to ==, \==, >>, >>=, <<, <<=.

REXX Programming Book for TSO (published 2012)

[Books Computer]

Home Books for Computer Professionals Privacy Terms |
Site Map and Site Search Programming Manuals and Tutorials The REXX Files Top of Page |