3. Embedded QUEL for COBOL : COBOL Variables and Data Types : Data Types : The Alphabetic, Alphanumeric, and Alphanumeric Edited Categories
 
Share this page                  
The Alphabetic, Alphanumeric, and Alphanumeric Edited Categories
EQUEL/COBOL accepts data declarations in the alphabetic, alphanumeric, and alphanumeric edited categories. The syntax for declaring data items in those categories is:
level-number data-name PIC [ISpic-string 
        [[USAGE [IS]] DISPLAY].
Syntax Note:
The pic-string can be any legal COBOL picture string for the alphabetic, alphanumeric and alphanumeric edited classes. The preprocessor notes only the length of the data item and that the data item is in the alphanumeric class.
You can use alphabetic, alphanumeric, and alphanumeric edited data items with any Ingres object of character (c, char, text or varchar) type. You can also use them to replace names of objects such as forms, fields, tables and columns. However, when a value is transferred into a data item from a Ingres object it is copied directly into the variable storage area without regard to the COBOL special insertion rules. When data in the database is in a different format from the alphanumeric edited picture, you must provide an extra variable to receive the data. You can then MOVE the data into the alphanumeric edited variable. However, if data in the database is in the same format as the alphanumeric edited picture (which would be the case, for example, if you had inserted data using the same variable you are retrieving into), you can assign the data directly into the edited data item, without any need for the extra variable. For more information on type conversion, see Data Type Conversion.
The following example illustrates the syntax for these categories:
##  01 ENAME         PIC X(20).
##  01 EMP-CODE      PIC xx/99/00.