View previous topic :: View next topic
|
Author |
Message |
rajaherein
New User
Joined: 11 Jan 2007 Posts: 23 Location: chennai
|
|
|
|
Hi,
Is that mandatory that no of variables passed from Calling to Called Program should be equal.
Is this criteria apply to both Static as well as Dynamic Calls. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
not only the number, but their position in the USING phrase is also important. It seems that you have not bothered to read the documentation. Links to appropriate language manuals are at the top of this page. |
|
Back to top |
|
|
rajaherein
New User
Joined: 11 Jan 2007 Posts: 23 Location: chennai
|
|
|
|
I think position is not important...... only the no matters.
Say
Pgm A:
Call B using 1,2,3
Pgm B:
Procedure division using 2,1,3
This will work....
Here we are refrencing the allocated memory locations |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
rajaherein wrote: |
I think position is not important...... only the no matters.
Say
Pgm A:
Call B using 1,2,3
Pgm B:
Procedure division using 2,1,3
This will work....
Here we are refrencing the allocated memory locations |
Wrong answer, if Pgm B is expecting the data area that Pgm A refers to as 1 to be in the second location, it will fail.
Besides, the number of items is not as critical, only the reference to items that do not exist. |
|
Back to top |
|
|
rajaherein
New User
Joined: 11 Jan 2007 Posts: 23 Location: chennai
|
|
|
|
Hi William,
Per your suggestions, the length of data area is important rather than numbers.
Please advice. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Position in the parameter sequence is critical as well as the definition of the parameter at each position. What may not be critical is if a called module is set up to handle 5 parameters and only the first 3 are used in a particular call. If the called module does not refer to parameter4 and parameter5, there should be no problem. This is sometimes seen when some sort of "service" module is called that can support a variety of functions and they do not all require all of the parameters. Typically, the first parameter has info that tells the callee what is being requested.
My preference is that the caller and the callee have the same definitions. |
|
Back to top |
|
|
rajaherein
New User
Joined: 11 Jan 2007 Posts: 23 Location: chennai
|
|
|
|
Hi Dick,
Thanks for your advice.
According to my observations, when the Called module has 5 parameters and Calling module has 3 parameters, then S0C4 occurs.
Correct me if i am wrong. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello Raj,
Yes. Typically, that happens when the called module tries to use the 2 parameters that were not passed. As i mentioned
Quote: |
If the called module does not refer to parameter4 and parameter5, there should be no problem. |
if the called module has 5 parameters and the caller only sends 3, the called module must have a way to know which parameters were used and ensure that parameters 4&5 are not used in that invocation.
Quote: |
Typically, the first parameter has info that tells the callee what is being requested |
Please let me know if i've not been clear. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Does standard linkage in the current COBOL still set the high bit to 1 on the last passed address? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Ouch
Or as kids in my old neighborhood would chant, "Nyah Nyah Nyah, Ny Nyahh Nyahh". . . . |
|
Back to top |
|
|
rajaherein
New User
Joined: 11 Jan 2007 Posts: 23 Location: chennai
|
|
|
|
Hello Dick,
Many Thanks, i got my doubts cleared by your comments. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Does standard linkage in the current COBOL still set the high bit to 1 on the last passed address?
|
It may, but all the object code that I have seen only generates setregs based on the USING list in the invoked modules PROCEDURE DIVISION statement. Since you can call with three and by called using only 2 - which will work and call with 3 and be called using 4 and receive a SOC4, I assume that the high-bit (if set) is never checked. |
|
Back to top |
|
|
ramfrom84
New User
Joined: 23 Aug 2006 Posts: 93 Location: chennai
|
|
|
|
Say
Pgm A:
Call B using 1,2,3
Pgm B:
Procedure division using 1,2
This will work.... |
|
Back to top |
|
|
|