SEARCH ALL



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

SEARCH ALL

Postby hvats83 » Fri Dec 21, 2012 11:26 am

In program there is a table defined below-

01  MMF-ACCOUNT-TABLE.
           05  MMF-INFO
               OCCURS 500000 TIMES
               ASCENDING KEY IS MMF-RK-ACCT-ID
               INDEXED BY MMF-INDEX MMF2-INDEX.
               10  MMF-RK-ACCT-ID        PIC 9(08).
               10  MMF-EOD-ST-AM         PIC S9(13)V9(2).

In program I am using search all on this table.If I use MMF2-INDEX in SEACH ALL operation, program is abending and on using index MMF-INDEX program runs successfully.

Please suggest me why this is happening.
hvats83
 
Posts: 18
Joined: Mon Dec 05, 2011 11:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: SEARCH ALL

Postby BillyBoyo » Fri Dec 21, 2012 12:08 pm

Can you provide details of the abend, please?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: SEARCH ALL

Postby hvats83 » Fri Dec 21, 2012 12:41 pm

Following error occurred-

IGYPS2117-E Subscripted item "MMF-RK-ACCT-ID" in "SEARCH ALL" statement was not indexed by the first index for that table. The first index was assumed.
hvats83
 
Posts: 18
Joined: Mon Dec 05, 2011 11:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: SEARCH ALL

Postby BillyBoyo » Fri Dec 21, 2012 1:12 pm

Well, that is not an abend, it is a compile error. If you re-read the message, it'll be clear that the SEARCH ALL is expected to use the first index for the table only. Why would you want to use a different index anyway?

These users thanked the author BillyBoyo for the post:
hvats83 (Fri Dec 21, 2012 1:28 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: SEARCH ALL

Postby hvats83 » Fri Dec 21, 2012 1:30 pm

Yes it is compile error and I wrongly mentioned it as abend.
I was not aware that we have to use first index in SEARCH ALL.
Thanks a lot for the reply.
hvats83
 
Posts: 18
Joined: Mon Dec 05, 2011 11:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: SEARCH ALL

Postby BillyBoyo » Fri Dec 21, 2012 1:44 pm

Well, it is there in the Language Reference:

The index used is always that associated with the first index-name specified in the OCCURS clause.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post