View previous topic :: View next topic
|
Author |
Message |
amiya_mf
New User
Joined: 01 Mar 2005 Posts: 18
|
|
|
|
Hi,
Is there any way to know the amount (size) of data is being passed to the called program?
Regards.
Amiya |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
amiya_mf wrote: |
Is there any way to know the amount (size) of data is being passed to the called program? |
Is there a requirement that does not allow you to look at the calling and/or called program? |
|
Back to top |
|
|
TG Murphy
Active User
Joined: 23 Mar 2007 Posts: 148 Location: Ottawa Canada
|
|
|
|
That is a flaw with the COBOL CALL statement. You can never be sure how many bytes the caller passed you.
Some places get around this problem by insisting that the caller pass the length to the called program. One way to do it would be to pass 2 parms for every parm you want to pass:
Parm 1 is always a PIC S9(9) COMP field that contains the LENGTH OF parm 2.
Parm 2 is the parm you wanted to pass.
If everyone follows this convention within your application, then you can catch situations where a copybook changes, but some programs that use the copybook fail to get recompiled.
That's just one way to do it. There are other ways.
It would be nice if the COBOL CALL statement populated some special register variable that could be tested by the called program. The CICS LINK command does this by populating EIBCALEN. |
|
Back to top |
|
|
|