Here is logic on how to pass data in COBOL using CALL BY Value and CALL BY Reference methods in COBOL.
How to Pass data From Main module to Submodule
You can do it in two ways. One is sharing address to sub-module, and the other is passing only content.
CALL BY Reference
Call ‘abcd‘ using data-1.
Here you share the address. So the called program can receive data that modified by the submodule. The CALL BY Reference is the default method in COBOL.
CALL BY Content
In the second case, you pass only data, and the called program can’t receive back from the submodule.
Call ‘abcd‘ by content using data-1.
- It is called CALL BY content. The called program can’t receive modified data (by Submodule).
- Suppose, you pass DATE to a submodule. But, the called program doesn’t receive it back since it is not needed. Here you can use this method. Here is list of free to download COBOL Materials.
Related Posts