Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us