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: 10210
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: 10210
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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm
No new posts Is it possible to pass variables of s... Csongor CLIST & REXX 2 Fri Jun 10, 2016 7:33 pm


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