View previous topic :: View next topic
|
Author |
Message |
Ashish.Srivastava.123
New User
Joined: 29 Jun 2014 Posts: 16 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Ashish.Srivastava.123
New User
Joined: 29 Jun 2014 Posts: 16 Location: India
|
|
|
|
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 |
|
|
Ralph Zbrog
New User
Joined: 21 Nov 2009 Posts: 58 Location: California
|
|
|
|
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 |
|
|
Ashish.Srivastava.123
New User
Joined: 29 Jun 2014 Posts: 16 Location: India
|
|
|
|
Hi Ralph ,
Thanks a million , it worked. |
|
Back to top |
|
|
|