IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Data size between main and sub program.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
amiya_mf

New User


Joined: 01 Mar 2005
Posts: 18

PostPosted: Fri Apr 27, 2007 5:17 pm
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: 3156
Location: Tucson AZ

PostPosted: Fri Apr 27, 2007 5:25 pm
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: 148
Location: Ottawa Canada

PostPosted: Sat Apr 28, 2007 1:28 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
Search our Forums:

Back to Top