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

Need to capture he value of index of a table


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

New User


Joined: 05 Jan 2007
Posts: 2
Location: mumbai

PostPosted: Fri Mar 23, 2007 12:28 am
Reply with quote

Hi,
I need to know the value of the index which I have used to define in the table.
The table defination is
01 PAYMENT-TABLE.
05 PAYMENT-ENTRY OCCURS 999 TIMES
INDEXED BY
PAYT-NDX.

To knoe the value of index I am moving it in dummy variable like this.
MOVE PAYT-NDX TO WS-DUMMY.

For this I am getting the following compilation error:
"PAYT-NDX" was defined as a type that was invalid in this context.

Let me know how I can check the value in the index.
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: Fri Mar 23, 2007 12:59 am
Reply with quote

Hello,

To "move" an array index, use SET instead of MOVE.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Mar 23, 2007 1:46 am
Reply with quote

What was the trick? Redefine a usage is index with a pic s9(9) comp or just set to the pic s9(9) comp?
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: Fri Mar 23, 2007 2:12 am
Reply with quote

Hello,

My guess is that the index in question is not defined as a field.

Usng the SET to a 9(9) COMP field should work as needed. . . . Haven't actually done it today, but seem to reacll doing it before icon_smile.gif
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 Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top