CLASS Clause

The CLASS clause relates a name to the specified set of characters listed in that clause.

Read syntax diagramSkip visual syntax diagram
CLASS Clause - Format

>>-CLASS--class-name-1--+----+---------------------------------->
                        '-IS-'   

   .---------------------------------------.   
   V                                       |   
>----literal-4--+------------------------+-+-------------------><
                '-+-THROUGH-+--literal-5-'     
                  '-THRU----'                  

class-name-1
Class-name-1 is a user-defined word and must contain at least one alphabetic character. The class-name in the CLASS clause can be a DBCS user-defined word. Class-name-1 can be referenced only in a class condition. See Class Condition for more information. The characters specified by the values of the literals in this clause define the exclusive set of characters of which class-name-1 consists.
literal-4, literal-5
If numeric, must be unsigned integers and must have a value from 1 through 256 (the maximum number of characters in the EBCDIC character set).

The value of each literal specifies the relative position, or ordinal number, of a character within the EBCDIC character set. Appendix C. EBCDIC and ASCII Collating Sequences lists the ordinal number for each character in the EBCDIC collating sequence.

IBM Extension

IBM Extension Start of changeCannot be specified as floating-point literals, DBCS literals, or national literals.End of change End of IBM Extension

End of IBM Extension

If nonnumeric, the literal is the actual character within the EBCDIC character set. If the value of the nonnumeric literal contains multiple characters, each character in the literal is included in the set of characters identified by class-name.

If the nonnumeric literal is associated with a THROUGH phrase, it must be one character in length.

THROUGH, THRU
If THROUGH is specified, class-name includes those characters beginning with the value of literal-4 and ending with the value of literal-5. In addition, the characters specified by a THROUGH phrase may specify characters in either ascending or descending order.