Comparison of Numeric and Nonnumeric Operands

Rules for numeric and nonnumeric comparisons are given in the following tables. If either of the operands is a group item, nonnumeric comparison rules apply.

Table 1 summarizes permissible comparisons with nonnumeric operands.

Table 2 summarizes permissible comparisons with numeric operands.

The symbols used in Table 1 and Table 2 are as follows:
Table 1. Permissible Comparisons with Nonnumeric Second Operands
FIRST OPERAND SECOND OPERAND
GR AL AN ANE NE FC¹ NNL DB DBE DA TI TS NL
NONNUMERIC OPERAND
Group (GR) NN NN NN NN NN NN NN     NN NN NN NN
Alphabetic (AL) NN NN NN NN NN NN NN           NLN
Alphanumeric (AN) NN NN NN NN NN NN NN     NN NN NN NLN
Alphanumeric Edited (ANE) NN NN NN NN NN NN NN     NN NN NN  
Numeric Edited (NE) NN NN NN NN NN NN NN     NU NU NU  
Figurative Constant (FC¹) NN NN NN NN NN               NL⁴
Nonnumeric Literal (NNL) NN NN NN NN NN         NN NN NN NLN
DBCS items (DB)³               NN NN       NLN
DBCS-edited items (DBE)³               NN NN        
Date (DA)³ NN   NN NN NU   NN     DT   DT  
Time (TI)³ NN   NN NN NU   NN       DT DT  
Timestamp (TS)³ NN   NN NN NU   NN     DT DT DT  
National (NL) NN NLN NLN     NL⁴ NLN NLN         NL
NUMERIC OPERAND
Figurative Constant ZERO (ZR) NN NN NN NN NN                
Numeric Literal (NL) NN NN NN NN NN         NU NU NU  
External Decimal (ED)² NN NN NN NN NN NN NN     NU NU NU Start of change NN End of change
Binary (BI)                   NU NU NU  
Arithmetic Expression (AE)                   NU NU NU  
Boolean data item or Boolean Literal (BO)³                          
Internal Decimal (ID)                   NU NU NU  
Internal Floating-Point (IFP)³                          
External Floating-Point (EFP)³ NN³ NN³ NN³ NN³ NN³ NN³ NN³            
Floating-Point Literal (FPL)³                          
Start of change National Decimal (ND) ²³ End of change Start of change NN End of change Start of change NN End of change Start of change NN End of change Start of change NN End of change Start of change NN End of change Start of change NN End of change Start of change NN End of change Start of change   End of change Start of change   End of change Start of change NU End of change Start of change NU End of change Start of change NU End of change Start of change NN End of change
Table 2. Permissible Comparisons with Numeric Second Operands
FIRST OPERAND SECOND OPERAND
ZR NL Start of change ED, ND End of change BI AE BO ID IFP³ EFP³ FPL³
NONNUMERIC OPERAND
Group (GR) NN NN NN²           NN³  
Alphabetic (AL) NN NN NN²           NN³  
Alphanumeric (AN) NN NN NN²           NN³  
Alphanumeric Edited (ANE) NN NN NN²           NN³  
Numeric Edited (NE) NN NN NN²           NN³  
Figurative Constant (FC¹)     NN²           NN³  
Nonnumeric Literal (NNL)     NN²           NN³  
Date (DA)   NU NU² NU NU   NU      
Time (TI)   NU NU² NU NU   NU      
Timestamp (TS)   NU NU² NU NU   NU      
NUMERIC OPERAND
Figurative Constant ZERO (ZR)     NU NU NU NU³ NU NU³ NU³  
Numeric Literal (NL)     NU NU NU   NU NU³ NU³  
External Decimal (ED) NU NU NU NU NU   NU NU³ NU³ NU³
Binary (BI) NU NU NU NU NU   NU NU³ NU³ NU³
Arithmetic Expression (AE) NU NU NU NU NU   NU NU³ NU³ NU³
Boolean data item or Boolean Literal (BO)³ NU³         NU³        
Internal Decimal (ID) NU NU NU NU NU   NU NU³ NU³ NU³
Internal Floating-Point (IFP)³ NU³ NU³ NU³ NU³ NU³   NU³ NU³ NU³ NU³
External Floating-Point (EFP)³ NU³ NU³ NU³ NU³ NU³   NU³ NU³ NU³ NU³
Floating-Point Literal (FPL)³     NU³ NU³ NU³   NU³ NU³ NU³  
Start of change National Decimal (ND) ²³ End of change Start of change NU End of change Start of change NU End of change Start of change NU End of change Start of change NU End of change Start of change NU End of change Start of change   End of change Start of change NU End of change Start of change NU³ End of change Start of change NU³ End of change Start of change NU End of change
Notes to Table 1 and Table 2:
¹
Includes all figurative constants except ZERO and NULL
²
Integer item only
³
IBM extension
Only for SPACE