The Read
action block fails to use the index even though the predicates in normal
COBOL programs would have made use of the index.
Best
Practice:
In spite of having separate Read action blocks for each read, the
entity views in the RAB should contain the required attributes. If attributes
other than those in index are to be accessed then, it is better to have
separate entity views.
For eg: Assume table T1 has index I1, I2, I3
respectively and the attributes in I1, I2 and I3 are A1, A2 and A3
respectively. Then a Read of the following type will be an Index read
instead of an Index Only Read.:
Entity View: Entity T1 A1,
A2,
A3
...
...
Read T1 where A1 = local view lcl_a1_value
The better way of coding this:
Entity View: Entity ent1_T1 A1,
Entity
ent2_T1 A2,
Entity ent3_T1 A3.
...
...
Read ent_T1 where A1 = local view lcl_a1_value