Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem with Index field while compiling the converted prog

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Problem with Index field while compiling the converted prog
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Oct 23, 2008 6:56 pm    Post subject: Re: Problem with Index field while compiling the converted p
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us