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

Pass the index variable to other sub program


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

New User


Joined: 29 Mar 2006
Posts: 34

PostPosted: Wed Apr 12, 2006 7:56 pm
Reply with quote

hi 2 all,

could u please give the clear answer to my query

why can't we pass the index variable to other sub programs?
is there any predefined comp value to index


thanks in advance
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Apr 15, 2006 10:51 pm
Reply with quote

Hi,

I assume you mean the index variable created by the "INDEXED BY" phrase.

You'll notice that it has no pic and is exclusively associated to the table in which it appears. Because of that the index info resides only in the calling pgm. The called pgm contains no info about the field and its connections.

You may get around this by building a duplicate table in the called pgm and moving the passed table data to it.

From this point it depends on what you're trying to do. If you just want to search the table there's nothing else to do but start the search by setting the index to the value you want and vary it.

If you want to use the index value from the calling pgm to access a particular table value you have to set the index to the value you passed in the CALL.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top