Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Can indexed table be used in linkage section?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
ermanisharora

New User


Joined: 10 Apr 2007
Posts: 7
Location: mumbai

PostPosted: Fri May 09, 2008 1:18 pm    Post subject: Can indexed table be used in linkage section?
Reply with quote

I read somewhere that indexed table cannot be used in the linkage section since the value of index is held by a register.

Corrections are welcome!!!!
Back to top
View user's profile Send private message
References
PostPosted: Fri May 09, 2008 1:18 pm    Post subject: Re: Can indexed table be used in linkage section? Reply with quote

the_gautam

Active User


Joined: 05 Jun 2005
Posts: 168
Location: Bangalore

PostPosted: Fri May 09, 2008 1:22 pm    Post subject:
Reply with quote

if you are talking about the problem in passing the index of a table declared in the main-program to the sub-program, then it is not possible. you can pass those variables through the LINKAGE SECTION which you have declared in the WORKING-STORAGE SECTION and the INDEX is not declared by the programmer in the WORKING-STORAGE SECTION.
Back to top
View user's profile Send private message
ermanisharora

New User


Joined: 10 Apr 2007
Posts: 7
Location: mumbai

PostPosted: Fri May 09, 2008 1:26 pm    Post subject:
Reply with quote

Thanks Gautam for the clarification.....
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 1200
Location: At my desk

PostPosted: Fri May 09, 2008 4:42 pm    Post subject:
Reply with quote

the_gautam wrote:
if you are talking about the problem in passing the index of a table declared in the main-program to the sub-program, then it is not possible. you can pass those variables through the LINKAGE SECTION which you have declared in the WORKING-STORAGE SECTION and the INDEX is not declared by the programmer in the WORKING-STORAGE SECTION.
But a usage index item can be set to an implicitly defined index and passed via linkage.....
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 1200
Location: At my desk

PostPosted: Fri May 09, 2008 4:50 pm    Post subject: Re: Can indexed table be used in linkage section?
Reply with quote

ermanisharora wrote:
I read somewhere that indexed table cannot be used in the linkage section since the value of index is held by a register.
The value is not 'held' there, it is defined internally in storage.
Any data description clause can be used to describe items in the linkage section with the following exceptions:
You cannot specify the VALUE clause for items other than level-88 items.
You cannot specify the EXTERNAL clause in the linkage section.

I don't see indexed table in that exception list......
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 498
Location: Richmond, Virginia

PostPosted: Fri May 09, 2008 6:03 pm    Post subject:
Reply with quote

Why not just try and see?
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8058
Location: 221 B Baker St

PostPosted: Sat May 10, 2008 3:01 am    Post subject:
Reply with quote

Hello,

Quote:
Why not just try and see?
And please post the result of the experiment here icon_smile.gif
Back to top
View user's profile Send private message
ermanisharora

New User


Joined: 10 Apr 2007
Posts: 7
Location: mumbai

PostPosted: Tue May 13, 2008 5:03 pm    Post subject: Reply to: Can indexed table be used in linkage section?
Reply with quote

Hi All,

I tried to use an indexed table in the linkage area of a program and it worked fine.
Conclusively, we can use an indexed table in the linkage section of a program but we cannot implicitly pass the value to this index from the calling program.

Please correct me if I my understanding is wrong!!!! icon_biggrin.gif
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 498
Location: Richmond, Virginia

PostPosted: Tue May 13, 2008 5:29 pm    Post subject:
Reply with quote

That would make sense. I note your use of "implicitly." Passing another variable with the index value SET to it works explicitly.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1524
Location: germany

PostPosted: Tue May 13, 2008 5:30 pm    Post subject:
Reply with quote

you can not explictly pass the value -

but you can set a numeric item to the index, pass the numeric item and the set the index to the numeric item in the called module - which would be implicitly passing.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1