View previous topic :: View next topic
|
Author |
Message |
sudhee_rb
New User
Joined: 29 Mar 2006 Posts: 34
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
|