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
 

 

Can indexed table be used in linkage section?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    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

the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
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: Good-gaon

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: 2150
Location: At my coffee table

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: 2150
Location: At my coffee table

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

Active Member


Joined: 31 Oct 2006
Posts: 962
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

Site Director


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

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: Good-gaon

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

Active Member


Joined: 31 Oct 2006
Posts: 962
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

Global Moderator


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

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
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts Updating online Db2 table kishpra DB2 3 Fri Aug 12, 2016 2:44 pm
No new posts Getting soc4 on internal table in cobol abdulrafi COBOL Programming 13 Fri May 06, 2016 3:39 pm


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