View previous topic :: View next topic |
Author |
Message |
hogandeveloper Beginner
Joined: 05 Aug 2008 Posts: 11 Topics: 10
|
Posted: Wed Nov 19, 2008 3:21 am Post subject: help needed for the subscript error |
|
|
Hi All,
I tried moving a field to another field as below
move field-e to field-DB
and i got the below error
"XXXX" WAS A TABLE-ITEM BUT WAS NOT
SUBSCRIPTED OR INDEXED. THE FIRST
OCCURRENCE OF THE TABLE WAS ASSUMED.
the field-E looks like below in the copybook05 X05000-ACCOUNT-RECORD.
10 field-a OCCURS 0 TO 20
DEPENDING ON field-b.
15 field-c PIC X(1).
15 field-d PIC 9(16) COMP-3.
15 field-e pic x(3).
can anyone please help me to sort out this error with an example
thanks,
HD |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Nov 19, 2008 4:35 am Post subject: |
|
|
at the top of the page, via 'Search Manuals', pick a cobol manual and read the appliction programmers guide about dealing with tables. Your answer to your question will become apparent very quickly after you have read some fundumental info about cobol internal tables.
Quote: | move field-e to field-DB
|
field-e always needs a subscript (since you did not assign an index to this table in the occurs clause.
the subscript can only have values 1 to 20.
Code: | move field-e(1) to field-DB
move field-e(ws-subscript) to field-DB
|
in the second example, ws-subscript must be populated correctly before the move statement is executed. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
|
|