Page 1 of 1

LINKING of Sub-Program

Posted: Sat Nov 01, 2008 10:28 am
by rajkumarprajapati
Program A calling program B&C,How to link the programs?

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

Posted: Sat Nov 01, 2008 5:27 pm
by Natarajan
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.