IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Linkage variables during multiple calls


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
umanaga

New User


Joined: 09 Apr 2007
Posts: 33
Location: India

PostPosted: Wed Sep 23, 2009 4:16 pm
Reply with quote

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? icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 23, 2009 4:31 pm
Reply with quote

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
View user's profile Send private message
umanaga

New User


Joined: 09 Apr 2007
Posts: 33
Location: India

PostPosted: Wed Sep 23, 2009 4:41 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 23, 2009 4:52 pm
Reply with quote

I would not trust such a behavior !
anway the behavior is ... wrong...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 23, 2009 9:09 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top