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
 

 

Pass the index variable to other sub program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Pass the index variable to other sub program
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    Post subject:
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


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