3. Embedded QUEL for COBOL : COBOL Variables and Data Types : Variable Usage : Using Indicator Data Items
 
Share this page                  
Using Indicator Data Items
The syntax for referring to an indicator data item is the same as for an elementary data item, except that an indicator variable is always associated with another COBOL data item:
data_item:indicator_item
Syntax Note:
The indicator data item must be a 2-byte integer numeric elementary data item. For example:
##  01 IND-1        PIC S9(4) USAGE COMP.
##  01 IND-TABLE.
##     02 IND-2     PIC S9(4) USAGE COMP OCCURS 5 TIMES.
##  01 NUMVAR       PIC S9(9) USAGE COMP.
##  01 EMPNAMES.
##     02 ENAME     PIC X(30) OCCURS 5 TIMES.
##  01 SUB1         PIC S9(4) USAGE COMP VALUE ZEROES. 
##  APPEND TO employee (empnum=NUMVAR:IND-1)
##  RETRIEVE (ENAME(SUB1): IND-2(SUB1)=
##  employee.empname)  
##  {
        program code
        ADD 1 TO SUB1
##  }