3. Embedded QUEL for COBOL : COBOL Variables and Data Types : Data Types : Indicator Data Items
 
Share this page                  
Indicator Data Items
An indicator data item is a 2-byte integer numeric data item. There are three possible ways to use these in an application:
In a statement that retrieves data from Ingres, you can use an indicator data item to determine if its associated host variable was assigned a null value.
In a statement that sets data to Ingres, you can use an indicator data item to assign a null to the database column, form field, or table field column.
In a statement that retrieves character data from Ingres, you can use the indicator data item as a check that the associated host variable is large enough to hold the full length of the returned character string.
An indicator declaration must have the following syntax:
level-number indicator-name PIC [IS] S9(p) [USAGE [IS]] COMP.
where p is less than or equal to 4.
The following is an example of an indicator declaration:
##  01 IND-VAR
    PIC S9(2) USAGE COMP.