Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6968
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: 2504
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 LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us