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
 

 

Data size between main and sub program.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
amiya_mf

New User


Joined: 01 Mar 2005
Posts: 19

PostPosted: Fri Apr 27, 2007 5:17 pm    Post subject: Data size between main and sub program.
Reply with quote

Hi,

Is there any way to know the amount (size) of data is being passed to the called program?

Regards.
Amiya
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Apr 27, 2007 5:25 pm    Post subject: Re: Data size between main and sub program.
Reply with quote

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

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Sat Apr 28, 2007 1:28 am    Post subject:
Reply with quote

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
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am


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