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

NAT1316 Index not within array structure


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ashish.Srivastava.123

New User


Joined: 29 Jun 2014
Posts: 16
Location: India

PostPosted: Thu Feb 26, 2015 4:27 am
Reply with quote

Hi All,

I am facing run time error in the program. This is working fine with Test data but when I run the program with Prod data , it errors out.

I am new to NATURAL and it is difficult to get its documentation also.
Can someone suggest/guide me. I know I have to increase the array size but I am not able to do it as I get compile errors.

Error message
Page 1
EXTRACTING DATA FROM FDT FILE 159 DBID 3
PROGABCD 1130 NAT1316 Index not within array structure.
NEXT FIN
NAT9978 ERROR OCCURRED DURING EXECUTION/COMPILATION

Explanation


Tx *** Short Text ***

Index not within array structure.

Ex *** Explanation ***

The index specified for an array is not within the dimensions
defined for the array.

Ac *** Recommended Action ***

Check program and correct error.


Code:


 MOVE *ISN TO DB2-XXXA_XXX_G_DETAIL_DATA.ISN   
 MOVE C*XXX-G-DETAIL-DATA TO #MAX               
 FOR #I1 = 1 TO #MAX                             
   IF DDM-VIEW.XXX-C-TAX-CODE   (#I1) NE ' ' OR  <-- ERROR LINE
      DDM-VIEW.XXX-A-TAX-LLL   (#I1) NE 0   OR 
      DDM-VIEW.XXX-A-TAX-CURR   (#I1) NE 0   OR 
      DDM-VIEW.XXX-A-TAX-CURR-ER(#I1) NE 0       


01 DDM-VIEW VIEW OF XXXA 
   02 XXX-N-EMPLID /* (A11)
   02 XXX-D-PAYDT /* (A8) 
--
--
--
02 XXX-I-SUB-TYPE /* (A3)                             
 02 XXX-G-DETAIL-DATA (40)                             
   /* PE GROUP - SET OCCURENCES LOWER IF ERROR OCCURS   
   03 XXX-C-TAX-CODE /* (A6)                           
   03 XXX-A-TAX-LLL /* (P9.2)                         
   03 XXX-A-TAX-CURR /* (P9.2)                         
   03 XXX-A-TAX-CURR-ER /* (P9.2)                     
 02 C*XXX-G-DETAIL-DATA /* (N3)


Thanks
Ashishsr123
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Feb 26, 2015 7:01 am
Reply with quote

Looks like you have some data where C*XXX-G-DETAIL-DATA which is not in the range one to 40. You have to find that record(s) and see what is wrong with it(them).
Back to top
View user's profile Send private message
Ashish.Srivastava.123

New User


Joined: 29 Jun 2014
Posts: 16
Location: India

PostPosted: Thu Feb 26, 2015 12:27 pm
Reply with quote

You are right , I put some display statements. 'C*XXX-G-DETAIL-DATA' is normally is 40 but it goes to 50 and program abends.

This could be data issue or we could increase array size.

I tried increasing array size but got below error.

Tx *** Short Text ***

Storage overflow while creating format buffers.

Ex *** Explanation ***

An overflow condition has occurred in the buffer used to store format
buffers which define the fields to be read from the database.

* Recommended Action ***

Reduce the number of files or number of fields referenced from the
database, reduce the program size, or ask your NATURAL administrator
if the USIZE parameter value can be increased.


Code:

02 XXX-G-DETAIL-DATA (50)    <-- changed to 50 from 40                         
   /* PE GROUP - SET OCCURENCES LOWER IF ERROR OCCURS   
   03 XXX-C-TAX-CODE /* (A6)                           
   03 XXX-A-TAX-LLL /* (P9.2)                         
   03 XXX-A-TAX-CURR /* (P9.2)                         
   03 XXX-A-TAX-CURR-ER /* (P9.2) 


[/code]
Back to top
View user's profile Send private message
Ralph Zbrog

New User


Joined: 21 Nov 2009
Posts: 58
Location: California

PostPosted: Fri Feb 27, 2015 2:42 am
Reply with quote

The C* variable (C*XXX-G-DETAIL-DATA) tells you how many occurrences are in the record, but you retrieve only 40. The 1316 tells you that you are trying to access occurrences that were not retrieved. The error will be corrected with the index range increase from 40 to 50, unless there are records with more than 50 occurrences.

To correct the format buffer error, move the number of occurrences from the group name to the individual fields. To simplify maintenance, use a named constant.
Code:
1 #MAX-O (I4)  CONST <50>

Code:
02 XXX-G-DETAIL-DATA
   /* PE GROUP - SET OCCURENCES LOWER IF ERROR OCCURS   
   03 XXX-C-TAX-CODE (#MAX-O)  /* (A6)                           
   03 XXX-A-TAX-LLL (#MAX-O)   /* (P9.2)                         
   03 XXX-A-TAX-CURR (#MAX-O)   /* (P9.2)                         
   03 XXX-A-TAX-CURR-ER (#MAX-O)   /* (P9.2)
Back to top
View user's profile Send private message
Ashish.Srivastava.123

New User


Joined: 29 Jun 2014
Posts: 16
Location: India

PostPosted: Fri Feb 27, 2015 8:45 pm
Reply with quote

Hi Ralph ,

Thanks a million , it worked.
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 -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Cobol file using index COBOL Programming 2
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts DL/I status code AK for GU call using... IMS DB/DC 1
No new posts To find an array of words (sys-symbol... JCL & VSAM 9
No new posts How to move values from single dimens... COBOL Programming 1
Search our Forums:

Back to Top