LINKING of Sub-Program

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
rajkumarprajapati
Member
Posts: 40
Joined: Tue Sep 18, 2007 1:17 pm

LINKING of Sub-Program

Post by rajkumarprajapati » Sat Nov 01, 2008 10:28 am

Program A calling program B&C,How to link the programs?

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

CALL statement in COBOL. CALL BY REFERENCE , CALL BY CONTENT

Post by Natarajan » Sat Nov 01, 2008 5:27 pm

You can use CALL statement to link program A and ProgramB and programC.


below is example for that.

Code: Select all

CALL PROGRAMB  USING  WS-A,WS-B. 
control will be passed to PROGRAMB with data available in WS-A, WS-B.

You can use the BY CONTENT, BY REFERENCE and BY VALUE phrases along with this statement.


CALL ... BY REFERENCE - when we use this option, the pointer to that data item will be passed to the subprogram. if there are any changes done by the subprogram, the changed value will be reflected in the callin g program.

CALL... BY CONTENT - Changes to the data item value in the called program do not affect the corresponding data item value in the calling program.

CALL... BY VALUE - very similar to BY CONTENT. This is primarily intended for communication with non-COBOL programs.

In COBOL-CICS programs, we use EXEC CICS LINK command to link the programs... if you want more details on this statement.... let me know.
Natarajan
Chennai

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others