IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can indexed table be used in linkage section?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ermanisharora

New User


Joined: 10 Apr 2007
Posts: 7
Location: Good-gaon

PostPosted: Fri May 09, 2008 1:18 pm
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
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Fri May 09, 2008 1:22 pm
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: Good-gaon

PostPosted: Fri May 09, 2008 1:26 pm
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: 2146
Location: At my coffee table

PostPosted: Fri May 09, 2008 4:42 pm
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: 2146
Location: At my coffee table

PostPosted: Fri May 09, 2008 4:50 pm
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: 1042
Location: Richmond, Virginia

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

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat May 10, 2008 3:01 am
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: Good-gaon

PostPosted: Tue May 13, 2008 5:03 pm
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: 1042
Location: Richmond, Virginia

PostPosted: Tue May 13, 2008 5:29 pm
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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 13, 2008 5:30 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
Search our Forums:

Back to Top