View previous topic :: View next topic
|
Author |
Message |
umanaga
New User
Joined: 09 Apr 2007 Posts: 33 Location: India
|
|
|
|
This is a bit lengthy question.
Program ABC has three parameters in procedure division. And statement
CALL 'ABC' using X, Y, Z
is passing all three parameters to ABC.
When I coded next statement
CALL 'ABC' using X, Y
This time I am not passing Z.
And will I be able to access variables present under Z? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
not at all...
what happened when You tried ??
most probably You should have got an abend...
the called subroutine expects to receive three parameters and only two were provided |
|
Back to top |
|
|
umanaga
New User
Joined: 09 Apr 2007 Posts: 33 Location: India
|
|
|
|
I also expected an abend. But surprised.
It is going good.
Is it like when
CALL 'ABC' using X, Y, Z is done and address exstablished Z in ABC is not lost once the program is completed, and during second call
CALL 'ABC' using X, Y i was able use variables under Z.
FYI..The way program ABC and Caller are linked static not dynamic load. Will this also cause above to work? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I would not trust such a behavior !
anway the behavior is ... wrong... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you correct the code to specify all 3 variables for each/every call. It doesn't matter that it happens to work now - what would matter is when something causes an abend later. . . Or worse - it runs incorrectly and does not abend. . . |
|
Back to top |
|
|
|