Hi,
I am using XP2000.I am working in IBM COBOL.The assembler subroutine is already there,i want to modify something in that assembler subroutine.So i am trying to understand the process how cobol calls assembler,how it pass the value and it gets back.
RM COBOL-85...anyway this concept isn't much different compared to what your caller is, for all subroutines use these.
Variables are passed either by value or by reference. This is probably what you will be most concerned with. The COBOL calling program will need to match the subroutine in how it is called.
A "By Value" reference is copied to an internal reference in the function. If it's not set as a constant, it can be changed, but changes will not be reflected outside of the function.
A "By Reference" reference is passed via pointer reference. It can be changed, and the change will be reflected in the main program after the call.
There are also many other methods regarding the order/way parameters are passed to subroutines. You will need to match this in the subroutine with how RM-COBOL handles things. But with the way your post reads, you are modifying and not creating, so this should not be a concern for you.
manni05,
It's been a long time since I have done this but your problem brings back some memories. Yes I did something like this a long time ago. Cobol calling assembler or RPG and vice versa.
I think your problem here can be summarized as:
1. Understanding the linkage between program languages. This is a big topic because you have to understand how data is shared. Just like Glenn said data can be passed by reference, value and also by content, either statically or dynamically.
2. Know how the parameters are being passed and received and the structures of the parameters. Know what is the common area being used by both program (sometimes they called it data areas).
3. If you are going to change something in assembler then do it in assembler and not in cobol. If you are going to change the structure of a parameter then you will have to do it in both programs because they need to match or you will get errors.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.