Page 1 of 1

How can we print index in COBOL?

Posted: Tue Nov 20, 2018 9:38 pm
by Pragya
Hi

How can we print index in COBOL? And is it readable?Please advise.

[ Post made via Android ] Image

Re: How can we print index in COBOL?

Posted: Tue Nov 20, 2018 10:41 pm
by nicc
What 'index'?

Re: How can we print index in COBOL?

Posted: Wed Nov 21, 2018 8:12 am
by Robert Sample
If you are talking about INDEX variables in COBOL, this information from the DISPLAY statement in the Enterprise COBOL Language Reference manual is relevant:
identifier-1
Identifier-1 references the data that is to be displayed. Identifier-1 can reference any data item except an item of usage PROCEDURE-POINTER, FUNCTION-POINTER, OBJECT REFERENCE, or INDEX. Identifier-1 cannot be an index-name.
If you are not talking about INDEX variables, you will need to explain more about what you mean.

Re: How can we print index in COBOL?

Posted: Thu Nov 22, 2018 6:42 pm
by Pragya
nicc wrote: Tue Nov 20, 2018 10:41 pmWhat 'index'?
An INDEX is used at the time of defining a COBOL Table, that's what I am talking about.

Re: How can we print index in COBOL?

Posted: Thu Nov 22, 2018 6:44 pm
by Pragya
Robert Sample wrote: Wed Nov 21, 2018 8:12 amIf you are talking about INDEX variables in COBOL, this information from the DISPLAY statement in the Enterprise COBOL Language Reference manual is relevant:
identifier-1
Identifier-1 references the data that is to be displayed. Identifier-1 can reference any data item except an item of usage PROCEDURE-POINTER, FUNCTION-POINTER, OBJECT REFERENCE, or INDEX. Identifier-1 cannot be an index-name.
If you are not talking about INDEX variables, you will need to explain more about what you mean.
Thanks Robert. That's what I meant but in the quote what is the difference between INDEX and index-name? Are they not just same?

Re: How can we print index in COBOL?

Posted: Fri Nov 23, 2018 3:42 am
by nicc
When you referred to the COBOL manual what did you find out?

Re: How can we print index in COBOL?

Posted: Fri Nov 23, 2018 4:54 am
by Robert Sample
Are they not just same?
Nope -- indexes can be defined with USAGE INDEX or they can be defined with INDEXED BY in a table definition.

Re: How can we print index in COBOL?

Posted: Mon Jan 21, 2019 12:45 pm
by Pragya
Thanks, got it.