Gokul, the thing to do is to try it out. Then check in the manual. Or check in the manual first, and see if you want to try it out.
The manual will tell you exactly how indexes are treated in all situations. The same of USAGE INDEX items.
If I'm doing a looping construct with an index, I like to do this sort of thing.
01 table-maximum-but-with-a-meaningful-name comp pic s9(8) or s9(4) depending on size of table
01 table-max-good-name-as-index USAGE INDEX
Assume also that the table itself has a-nicely-named-index.
At the "top" or the program or "first time",
SET a-nicely-named-index TO table-maximum-but-with-a-meaningful-name
SET table-max-good-name-as-index TO a-nicely-named-index
The I use table-max-good-name-as-index for the maximum test. Save the compiler some conversions. Maybe doesn't matter these days, but it's what I like to do.
I also like to check that the table-maximum-but-with-a-meaningful-name has the correct value.
01 nicely-named-table-max comp pic s9(4) value +100.
05 table-entry occurs 100 times.
10 table-entry-value pic xx.
10 table-entry-flag pic x.
How would you put in code, to check at run time, that the value of nicely-named-table-max is the same as the number of occurs. The idea is, if someone comes along and changes one without the other, how do you trap it automatically?
Hint: Look at the special-register LENGTH OF or the FUNCTION LENGTH,