Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Linkage variables during multiple calls

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Linkage variables during multiple calls
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Wed Sep 23, 2009 4:31 pm    Post subject: Reply to: Linkage variables during multiple calls
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    Post subject: Reply to: Linkage variables during multiple calls
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Wed Sep 23, 2009 4:52 pm    Post subject: Reply to: Linkage variables during multiple calls
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

Site Director


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

PostPosted: Wed Sep 23, 2009 9:09 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us