3. Embedded QUEL for COBOL : COBOL Variables and Data Types : Data Types : The Numeric Edited Data Category
 
Share this page                  
The Numeric Edited Data Category
The syntax for a declaration of numeric edited data is:
level-number data-name PIC [ISpic-string [[USAGE [IS]] DISPLAY].
Syntax Notes:
The pic-string can be any legal COBOL picture string for numeric edited data. The preprocessor notes only the type, scale, and size of the data item.
In order to interact with Ingres integer-valued objects, the picture string must describe a maximum of 10 digit positions with no scaling.
While you can use numeric edited data items to assign data to, and receive data from, Ingres database tables and forms, be prepared for some loss of precision for numeric edited data items with scaling. The runtime interface communicates using integer (COMP) or packed (COMP-3) variables for UNIX or float (COMP-2) variables for VMS.
In moving from these variables into your program's edited data items, truncation can occur due to MOVE statement rules and the COBOL standard alignment rules. For more information on type conversion, see Data Type Conversion.
The following example illustrates the numeric edited data category:
##  01 DAILY-SALES          PIC $$$,$$9DB USAGE DISPLAY.
##  01 GROWTH-PERCENT       PIC ZZZ.9(3) USAGE DISPLAY.