How can we print index in COBOL?

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

How can we print index in COBOL?

Post by Pragya »

Hi

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

[ Post made via Android ] Image
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: How can we print index in COBOL?

Post by nicc »

What 'index'?
Regards
Nic
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: How can we print index in COBOL?

Post 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.
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Re: How can we print index in COBOL?

Post 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.
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Re: How can we print index in COBOL?

Post 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?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: How can we print index in COBOL?

Post by nicc »

When you referred to the COBOL manual what did you find out?
Regards
Nic
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: How can we print index in COBOL?

Post 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.
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Re: How can we print index in COBOL?

Post by Pragya »

Thanks, got it.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”