View previous topic :: View next topic
|
Author |
Message |
rakeshnaredlla
New User
Joined: 04 Aug 2008 Posts: 26 Location: Hyderabad
|
|
|
|
HI,
I have converted a program from OS/VS langlvl(2) to Cobol 390(Enterprise COBOL) using the CCCA tool . The problem which I am getting is during the compilation of Cobol 390 prog. Please find the error below:
Code: |
IGYPA3025-E "CA-ABPA-INDEX2 (INDEX NAME)" was set to a value "751" which was greater than the maximum number of occurrences of the table it indexes. The value was accepted. |
This Index is decalred for a table of size 750.Please find the declaration below:
Code: |
05 CA-ABPA-TABLE2.
10 CA-ABPA-TABLE2-ENTRY OCCURS 750 TIMES
INDEXED BY CA-ABPA-INDEX2. |
In procedure division the following code is present
Code: |
PERFORM 0620-LOOP-AND-PROCESS THRU 0620-EXIT
VARYING CA-ABPA-INDEX2 FROM 1 BY 1
UNTIL CA-ABPA-INDEX2 > 750. |
Code: |
0620-LOOP-AND-PROCESS.
IF CA-ABPA-TBL2-KEY (CA-ABPA-INDEX2) = SPACES
SET CA-ABPA-INDEX2 TO 751
GO TO 0620-EXIT. |
Even though the NOSSRANGE is set by default . I am getting this
error.
I am using Enterprise COBOL for z/OS 3.4.1 version.
Please help my out to resolve this issue. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
change this:
Code: |
PERFORM 0620-LOOP-AND-PROCESS THRU 0620-EXIT
VARYING CA-ABPA-INDEX2 FROM 1 BY 1
UNTIL CA-ABPA-INDEX2 > 750.
0620-LOOP-AND-PROCESS.
IF CA-ABPA-TBL2-KEY (CA-ABPA-INDEX2) = SPACES
SET CA-ABPA-INDEX2 TO 751
GO TO 0620-EXIT.
........
|
to this:
Code: |
PERFORM 0620-LOOP-AND-PROCESS THRU 0620-EXIT
VARYING CA-ABPA-INDEX2 FROM 1 BY 1
UNTIL CA-ABPA-INDEX2 > 750
OR CA-ABPA-TBL2-KEY (CA-ABPA-INDEX2) = SPACES.
0620-LOOP-AND-PROCESS.
..............
|
|
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Why not define a second table-index and use this as your maximum table-index threshold. Because it's dynamcally calculated, if someone changes the OCCURS, it will always be correct.
Example -
Code: |
05 CA-ABPA-TABLE2.
10 CA-ABPA-TABLE2-ENTRY OCCURS 750 TIMES
INDEXED BY CA-ABPA-INDEX2,
CA-ABPA-INDEX2-MAX.
05 WS-FWORD PIC 9(08) BINARY.
05 WS-FWORD-X REDEFINES WS-FWORD.
10 FILLER PIC X(02)
10 WS-HWORD PIC 9(04) BINARY.
*
MOVE LENGTH OF CA-ABPA-TABLE2-ENTRY (1)
TO WS-FWORD.
DIVIDE LENGTH OF CA-ABPA-TABLE2
BY WS-FWORD
GIVING WS-FWORD.
SET CA-ABPA-INDEX2-MAX TO WS-HWORD.
|
So, to get out of the PERFORM early, you could issue -
Code: |
SET CA-ABPA-INDEX2 TO CA-ABPA-INDEX2-MAX
SET CA-ABPA-INDEX2 UP BY 1
GO TO 0620-EXIT.
|
Regards,
Bill |
|
Back to top |
|
|
ridgewalker58
New User
Joined: 26 Sep 2008 Posts: 51 Location: New York
|
|
|
|
Either change the table occurs clause to 751 and NEVER use occurence 751
OR
01 WS-ABPA-LOOP-CTL PIC X(01) VALUE 'N'.
MOVE 'N' TO WS-ABPA-LOOP-CTL.
PERFORM 0620-LOOP-AND-PROCESS THRU 0620-EXIT
VARYING CA-ABPA-INDEX2 FROM 1 BY 1
********* UNTIL CA-ABPA-INDEX2 > 750.
UNTIL WS-ABPA-LOOP-CTL = 'Y'.
0620-LOOP-AND-PROCESS.
IF CA-ABPA-TBL2-KEY (CA-ABPA-INDEX2) = SPACES
MOVE 'Y' TO WS-ABPA-LOOP-CTL
********* SET CA-ABPA-INDEX2 TO 751
GO TO 0620-EXIT. |
|
Back to top |
|
|
|