When to use PROCEDURE-POINTER phrase?

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Neeraj N
Registered Member
Posts: 54
Joined: Tue Aug 20, 2013 12:49 pm

When to use PROCEDURE-POINTER phrase?

Post by Neeraj N »

In one of the programs I've seen that they are using PROCEDURE-POINTER phrase. Have read about it here: https://www.ibm.com/support/knowledgece ... ddepro.htm but I could not really understand when do we really made a decision to make use of PROCEDURE-POINTER? Could someone please guide me on this.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: When to use PROCEDURE-POINTER phrase?

Post by Robert Sample »

A PROCEDURE-POINTER is needed if AND ONLY IF you need the starting address of a program. This is needed for certain LE functions. The PROCEDURE-POINTER is rarely used.
Neeraj N
Registered Member
Posts: 54
Joined: Tue Aug 20, 2013 12:49 pm

Re: When to use PROCEDURE-POINTER phrase?

Post by Neeraj N »

Thanks Robert. Is this pointer is like the pointers we use C?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: When to use PROCEDURE-POINTER phrase?

Post by Robert Sample »

Most likely, someone read about the PROCEDURE-POINTER and decided to implement it in your application without really having a need for it. Many new features of COBOL get used just so people can say they've used the feature, not because the need exists for the feature in that application. A PROCEDURE-POINTER would come in handy in only a very few circumstances -- such as when you have nested COBOL programs and want to know the original program name, for example.
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.”