Page 1 of 1

Display index in COBOL.

Posted: Sat Nov 22, 2014 6:46 pm
by Anshul Gupta
Hi,

Can the index be moved to a display-able field? Is there any way to display the value in an index in COBOL?

Re: Display index in COBOL.

Posted: Sat Nov 22, 2014 8:28 pm
by William Collins
What does the Enterprise COBOL Language Reference say that you can do with an index (assuming you mean the INDEXED BY field)? Identifying what you can't do should lead you to something you can do.

Re: Display index in COBOL.

Posted: Sun Nov 23, 2014 9:05 am
by Robert Sample
Is there any way to display the value in an index in COBOL?
You are asking a VERY fuzzy question here. When you want to display the value of an index, do you want to display
- the actual address (which is 8 hexadecimal digits)?
- the offset into the table (which would be a hexadecimal value starting at zero and going up by the table length)?
- the element number being referenced (i.e., a subscript value)?

There are good arguments to be made for each of these three possibilities.

Re: Display index in COBOL.

Posted: Sun Nov 23, 2014 10:17 am
by Anshul Gupta
Thanks. Robert, Third point of yours is what I'm after.