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

Problem with Index field while compiling the converted prog


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rakeshnaredlla

New User


Joined: 04 Aug 2008
Posts: 26
Location: Hyderabad

PostPosted: Thu Oct 23, 2008 5:52 pm
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Oct 23, 2008 6:16 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Oct 23, 2008 6:56 pm
Reply with quote

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

New User


Joined: 26 Sep 2008
Posts: 51
Location: New York

PostPosted: Tue Oct 28, 2008 12:10 am
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts Cobol file using index COBOL Programming 2
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top