Cobol/cobol

Advertisement


Question
Is there any, pointer concept in cobol if yes please tell me it in detail with an example ?

Answer
COBOL does support POINTERs.
They can be associated with Data in either FILE, LINKAGE or a STORAGE section.
Also, you can have FUNCTION POINTER similar to C++ Function pointers and Procedure Pointer which works the same way.

The use of pointers is not real simple, but it is straight forward.  Consult your language reference manual for your specific compiler implementation for what is supported and sample code.

The data pointer can be set by: [SET pointer-name to ADDRESS OF Storage-variable-name] and related syntax.
Data pointers are commonly used.  I have never used a 'function pointer' in COBOL.

David  

Cobol

All Answers


Answers by Expert:


Ask Experts

Volunteer


David Nelson

Expertise

I specialize in IBM z/OS COBOL and MicroFocus OCDS and Server Express non-OOP. Design, coding and performance oriented questions. Also linking to IBM Assembler from COBOL. Because the rules change with version, please state language level, version and platform environment. See CICS for questions about CICS.

Experience

Over 30 years working with COBOL on multiple platforms and OS.

Education/Credentials
Graduate, New York School of Computer Technology.

Past/Present Clients
Major Financial Institutions, State of NC (DHHS), Manufacturing, Financial services, Warehousing, Software developer and others.

©2012 About.com, a part of The New York Times Company. All rights reserved.