Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

X 6.2.33.6.1 Example of COBOL/C Interoperability (OS/390)




X The following example demonstrates a COBOL CALL to a C function that
X returns a function-pointer to a service, followed by a COBOL CALL to the
X service:


 X   IDENTIFICATION DIVISION.
 X   PROGRAM-ID DEMO.
 X   DATA DIVISION.
 X   WORKING-STORAGE SECTION.
 X   01 FP USAGE POINTER.
 X   01 PP USAGE PROCEDURE-POINTER.
 X   PROCEDURE DIVISION.
 X       CALL "c-function" RETURNING FP.
 X       SET PP TO FP.
 X       CALL PP.


X For OS/390 and VM, COBOL PROCEDURE-POINTERs are 8-bytes in length. Thus,
X the SET statement is needed to convert the function pointer (FP) to the
X COBOL PROCEDURE-POINTER (PP).

Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.