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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm


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