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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am


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