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
 

 

Need to capture he value of index of a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Need to capture he value of index of a table
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

Site Director


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

PostPosted: Fri Mar 23, 2007 12:59 am    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Fri Mar 23, 2007 1:46 am    Post subject:
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

Site Director


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

PostPosted: Fri Mar 23, 2007 2:12 am    Post subject:
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    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 Loading data to table gives wrong for... Raghu navaikulam DB2 16 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


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