Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.1.6.2 Class Condition



The class condition determines whether the content of a data item is alphabetic, alphabetic-lower, alphabetic-upper, numeric, or contains only the characters in the set of characters specified by the CLASS clause as defined in the SPECIAL-NAMES paragraph of the Environment Division.


X The class condition determines whether the contents of a data item are
X DBCS or KANJI.


    ___ Format _____________________________________________________________ 
   |                                                                        |
   | >>__identifier-1__ ____ __ _____ __ _NUMERIC__________ _____________>< |
   |                   |_IS_|  |_NOT_|  |_ALPHABETIC_______|                |
   |                                    |_ALPHABETIC-LOWER_|                |
   |                                    |_ALPHABETIC-UPPER_|                |
   |                                    |_class-name_______|                |
   |                                    |_ DBCS ___________|                |
   |                                    |_ KANJI __________|                |
   |                                                                        |
   |________________________________________________________________________|
identifier-1
Must reference a data item whose usage is explicitly or implicitly DISPLAY.


X Identifier-1 can reference a data item whose usage is explicitly or
X implicitly DISPLAY-1.

If identifier-1 is a function-identifier, it must reference an alphanumeric function.

NOT
When used, NOT and the next key word define the class test to be executed for truth value. For example, NOT NUMERIC is a truth test for determining that an identifier is nonnumeric.

NUMERIC
Identifier consists entirely of the characters 0 through 9, with or without an operational sign.

If its PICTURE does not contain an operational sign, the identifier being tested is determined to be numeric only if the contents are numeric and an operational sign is not present.

If its PICTURE does contain an operational sign, the identifier being tested is determined to be numeric only if the item is an elementary item, the contents are numeric, and a valid operational sign is present.

The NUMERIC test cannot be used with an identifier described as alphabetic or as a group item that contains one or more signed elementary items.

For numeric data items, the identifier being tested can be described
X as USAGE DISPLAY or (as IBM extensions) USAGE COMPUTATIONAL-3, or
X USAGE PACKED-DECIMAL.

ALPHABETIC
Identifier consists entirely of any combination of the lowercase or uppercase alphabetic characters A through Z and the space.

The ALPHABETIC test cannot be used with an identifier described as numeric.

ALPHABETIC-LOWER
Identifier consists entirely of any combination of the lowercase alphabetic characters a through z and the space.

The ALPHABETIC-LOWER test cannot be used with an identifier described as numeric.

ALPHABETIC-UPPER
Identifier consists entirely of any combination of the uppercase alphabetic characters A through Z and the space.

The ALPHABETIC-UPPER test cannot be used with an identifier described as numeric.

class-name
Identifier consists entirely of the characters listed in the definition of class-name in the SPECIAL-NAMES paragraph.

The class-name test must not be used with an identifier described as numeric.


X DBCS

X >_Host_> Under OS/390 and VM, the identifier consists entirely of DBCS
X characters. For DBCS data items, the identifier being tested must be
X described explicitly or implicitly as USAGE DISPLAY-1. Each byte of
X the DBCS identifier being tested can contain characters that range in
X value from X'00' through X'FF'. <_Host_<


X >_Workstation_> Under AIX, OS/2, and Windows, the identifier contains
X DBCS characters that correspond to valid OS/390 DBCS characters.
X <_Workstation_<


X For all platforms, a range check is performed on the data portion of
X the item for valid character representation. The valid range is X'41'
X through X'FE' for both bytes of each DBCS character and X'4040' for
X the DBCS blank. (These ranges are for the equivalent DBCS character
X representation for OS/390, not the actual DBCS character value ranges
X of the workstation DBCS characters.)


X KANJI

X >_Host_> Under OS/390 and VM, the identifier consists entirely of DBCS
X characters. For KANJI data items, the identifier being tested must be
X described explicitly or implicitly as USAGE DISPLAY-1. Each byte of
X the DBCS identifier being tested can contain characters that range in
X value from X'00' through X'FF'. <_Host_<


X >_Workstation_> Under AIX, OS/2, and Windows the identifier contains
X DBCS characters that correspond to valid OS/390 DBCS characters.
X <_Workstation_<


X For all platforms, a range check is performed on the data portion of
X the item for valid character representation. The valid range is from
X X'41' through X'7F' for the first byte, from X'41' through X'FE' for
X the second byte, and X'4040' for the DBCS blank. (These ranges are
X for the equivalent DBCS character representation for OS/390, not the
X actual DBCS character value ranges of the workstation DBCS
X characters.)

The class test is not valid for items defined as USAGE IS INDEX, as these items do not belong to any class or category.


X The class test is not valid for items defined as USAGE IS POINTER or USAGE
X IS PROCEDURE-POINTER, as these items do not belong to any class or
X category.


X The class condition cannot be used for external floating-point (USAGE
X DISPLAY) or internal floating-point (USAGE COMP-1 and USAGE COMP-2) items.

Table 20shows valid forms of the class test.


 Table 20. Valid Forms of the Class Test for Different Types of            
           Identifiers                                                     
 Type of Identifier                Valid Forms of the Class Test           
 Alphabetic            
                       
                       
                       
 ALPHABETIC        
 ALPHABETIC-LOWER  
 ALPHABETIC-UPPER  
 class-name        
 NOT ALPHABETIC                
 NOT ALPHABETIC-LOWER          
 NOT ALPHABETIC-UPPER          
 NOT class-name                
 Alphanumeric,         
 Alphanumeric-edited,  
 or Numeric-edited     
                       
                       
 ALPHABETIC        
 ALPHABETIC-LOWER  
 ALPHABETIC-UPPER  
 NUMERIC           
 class-name        
 NOT ALPHABETIC                
 NOT ALPHABETIC-LOWER          
 NOT ALPHABETIC-UPPER          
 NOT NUMERIC                   
 NOT class-name                
 External-Decimal      
RevisionX  or Internal-Decimal   
 NUMERIC           
RevisionX                    
 NOT NUMERIC                   
RevisionX                                
RevisionX  DBCS                  
RevisionX                        
RevisionX  DBCS              
RevisionX  KANJI             
RevisionX  NOT DBCS                      
RevisionX  NOT KANJI                     




Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.