Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Data security erase on RAID device steve-myers All Other Mainframe Topics 0 Sat Jan 13, 2018 6:41 am
No new posts Append the milliseconds to the data s... girishb2 DFSORT/ICETOOL 1 Thu Dec 21, 2017 9:07 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us