MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

help needed for the subscript error

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
hogandeveloper
Beginner


Joined: 05 Aug 2008
Posts: 11
Topics: 10

PostPosted: Wed Nov 19, 2008 3:21 am    Post subject: help needed for the subscript error Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Nov 19, 2008 4:35 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group