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

index search exceeds record limit of (100000) abend


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Elaine Pinnington

New User


Joined: 07 Dec 2007
Posts: 6
Location: France

PostPosted: Fri Sep 21, 2012 8:23 pm
Reply with quote

Hi,

I have a CICS/VSAM program that searches a file using various indexes based on criteria supplied by a user. The problem is that every so often the program abends because the limit of 10000 records searched has been exceeded. Is there a way of intercepting this count or abend so that we send an error message back to the front end and log the search criteria that they were using???
We have no control over the front end and the search criteria are not very well validated.

It is a very long time since I have worked with CICS and VSAM (abt 15 years).

Thanks
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: Fri Sep 21, 2012 8:34 pm
Reply with quote

Suspicious. Are you using a subscript, defined as S9(04) COMP and the program was compiled using the TRUNC(OPT) compiler option?

If true, define the S9(04) COMP field as S9(08) COMP and you'll be OK.

If your compiler support COMP-5 (Native Binary) you can keep the S9(04) variable, just redefine it as COMP-5 or just redefine it as S9(08) COMP-5, which is even better.

Indices (as opposed to subscripts) do have some type of limit (probably X'7FFFFFFF'), but certainly not 100000....
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: Fri Sep 21, 2012 8:46 pm
Reply with quote

Elaine,

Your post-header indicates 100000 (One Hundred Thousand) but your post-text indicates 10000 (Ten Thousand).

Typo?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Sep 21, 2012 8:54 pm
Reply with quote

Isn't this going to be some "limit" set in a program somewhere?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Sep 21, 2012 8:55 pm
Reply with quote

apologize for raining on your parade Elaine,
but
Quote:
the search criteria are not very well validated.

could some type of validation be implemented?

Unfortunately,
your use of the word index is somewhat confusing.

are you talking about alternate indexes to the vsam file,
or COBOL Internal table Indexes.

i have never encounter the type of error to which you refer.

could you be a little more specific, like:
search? how are you doing a search?
limit?
actual response code returned by the CICS API that you are CALLing?

obviously, I have no idea what you are talking about.
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: Sat Sep 22, 2012 2:58 am
Reply with quote

Elaine,

You can dynamically calculate the maximum OCCURS without knowing it, provided that the table be structured similar to the following -

Code:

03  WS-FWORD PIC 9(08) COMP.
03  WS-TABLE-REC.
    05  WS-TABLE-ENTRY OCCURS 10000 TIMES
                       INDEXED BY X-WS-TE, X-WS-TE-MAX
                       PIC  X(20).

DIVIDE LENGTH OF WS-TABLE-REC BY LENGTH OF WS-TABLE-ENTRY (1)
                              GIVING WS-FWORD.
SET  X-WS-TE-MAX              TO WS-FWORD.

After the SET, X-WS-TE-MAX equals 10000 (or for those of you watching at home, the "calculated max table-displacement"). Then, always use the TE-MAX index together with the TE index throughout the program and you'll never go out of table-range. You should perform this calculation in program HOUSEKEEPING.

There are other ways to dynamically calculate a max-occurs, but this is the most straightforward.

HTH....
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Sep 22, 2012 4:05 am
Reply with quote

Just out of interest, this works as well:

Code:
DIVIDE LENGTH OF WS-TABLE-REC BY LENGTH OF WS-TABLE-ENTRY
                              GIVING WS-FWORD


The subscript is not needed for WS-TABLE-ENTRY with Enterprise Cobol. Makes some sense in that all entries are the same length, regardless of which one you happen to choose.

Some non-IBM Cobols require the presence of a subscript.
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: Sat Sep 22, 2012 4:21 am
Reply with quote

Bill,

I began using this calculation with the introduction of COBOL II, in the mid-80's. Old habits die hard. icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sat Sep 22, 2012 9:03 am
Reply with quote

Hello,

Quote:
The problem is that every so often the program abends because the limit of 10000 records searched has been exceeded.
This is similar to posting "it didn't work" - which is our least productive thing to deal with. . .

Is the abend always the same? Is there some reason it has not been posted?

Getting help will take much longer if we have to get to the needed information bit-by-bit.
Back to top
View user's profile Send private message
Elaine Pinnington

New User


Joined: 07 Dec 2007
Posts: 6
Location: France

PostPosted: Tue Sep 25, 2012 6:41 pm
Reply with quote

Hello,

My appologies for the poor explanantion.

The program is a CICS module that looks up bank transaction detail from a VSAM file. In certain cases it does a readprev on an alternate index on said VSAM file. Under certain circumstances (I assume the readprev has searched through more than the threashold of 100000 records and still not found what it is looking for) the CICS module abends with a threashold limit exceeded.
My French collegues have tried to narrow down the search criteria so that this abend doesn't happen but it still happens fairly often.
I figured that it would be better to trap the abend and handle it in a controlled manner rather than fiddle with the search criteria and then analyze the search that are causing the problem.
At the moment the program just checks EIBRESP for NOT FOUND and EOF. Noone here has any CICS/VSAM experience. I tried googling for any info on this abend but with no luck.
I figure that if all else fails I'll just trap add a test for any other error (other than NOT FOUND or EOF) and handle it as a threshold exceeded error.
the code sample is this ...

Code:
 EXEC CICS READPREV                                     
           DATASET   (WS-FILE-FORMAT)                   
           INTO      (FTHST-RECORD)                     
           LENGTH    (LENGTH OF FTHST-RECORD)           
           RIDFLD    (WS-HST-KEY)                       
           KEYLENGTH (WS-HST-KEY-LENGTH)               
 END-EXEC.                                             
                                                       
 TEST RETURN-CODE CICS                                 
 ---------------------                                 
 IF   EIBRESP = DFHRESP(ENDFILE)                       
 OR   EIBRESP = DFHRESP(NOTFND)                         
      MOVE 'Y'                TO WS-BROWSE-END-FLAG     
      GO                      TO 3700-10-EXIT           
 END-IF.

I hope, this explanantion is clearer.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Sep 25, 2012 7:16 pm
Reply with quote

why not start with a START BROWSE, then do a READ PREV?

and who/what is generating the 10000(0) index search error message?????????
don't think that it is the op-sys, i think it is a user written error.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 25, 2012 7:55 pm
Reply with quote

Quote:
I assume the readprev has searched through more than the threashold of 100000 records
An alternate index cannot refer to more than 32767 prime keys, so if your program is truly using 100000 as the limit then the question would be what it is reading after it goes past the alternate index?

How many occurrences does the VSAM file alternate index defintion allow for? If the definition is set up for 32767, for example, and your limit is 10000 instead of 100000, then it is quite possible that your program IS exceeding the limit - depending upon the data in the file.

Another thing to investigate is the TRUNC option, if the CICS program is written in COBOL. The TRUNC option affects COMP pictures in COBOL, which could have an impact.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Sep 25, 2012 8:20 pm
Reply with quote

of the possible conditions:
DUPKEY,
ENDFILE,
FILENOTFOUND,
ILLOGIC, |
INVREQ,
IOERR,
ISCINVREQ,
LENGERR,
LOCKED,
NOTAUTH,
NOTFND,
RECORDBUSY,
SYSIDERR

the code checks for ENDFILE and NOTFND.
does the code following suggest that the resp is ok
if it is not the two mentioned?

also, what is this stuff about walking thru an index?
readprev presents the record or not.
what search is going on??????
Back to top
View user's profile Send private message
Elaine Pinnington

New User


Joined: 07 Dec 2007
Posts: 6
Location: France

PostPosted: Tue Sep 25, 2012 8:43 pm
Reply with quote

They do start with a start browse, then a read prev.

The program abends like this .....

Abend RLFC in transaction FRFX Pgm(TSFTVWH1) occured on CICS CIBDFPA9

Threshold exceeded

File control requests exceeded. > (100000 request VSAM)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Sep 25, 2012 8:48 pm
Reply with quote

Hello,

Can you count how many entries there are for the "key"(s) that run amok?

Possibly the program has gone into a loop and is re-reading things over and over - until the threshold is exceeded?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Sep 25, 2012 9:12 pm
Reply with quote

of course the program builds some kind of key
and then also builds a low-key as a stop?

and DFHRESP(NORMAL) should be the only test after the READPREV.
anything else should be treated as an exception.
Back to top
View user's profile Send private message
Elaine Pinnington

New User


Joined: 07 Dec 2007
Posts: 6
Location: France

PostPosted: Wed Sep 26, 2012 2:16 pm
Reply with quote

Hello,

I thought that when you pass a key to a read prev it would go off and read through the index until it finds a match (or not). The problem here is that with certain keys it is possible that the keyed read goes past the threshold of 100000 records (causing an abend) before it finds a match or reaches EOF. I was hoping that there would be some way of trapping this abend and handling it.

If I just add a catch-all that picks up on any EIBRESP that comes back other than OK, EOF and NOT FOUND then I at least capture some more information and handle the error in a more controlled manner.

With an error like this, does it return to the program with some kind of error code or does CICS just end the program ???

We can't recreate this error in DEV or UAT so can't just experiment!!!

Thanks
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Sep 26, 2012 4:29 pm
Reply with quote

Quote:
I thought that when you pass a key to a read prev it would go off and read through the index until it finds a match (or not)
This is not true. READPREV will read a single record and return a normal EIBRESP, or it will fail the read and return a non-normal EIBRESP.
Quote:
With an error like this, does it return to the program with some kind of error code or does CICS just end the program ???
It is not clear what you are referring to here. If you are asking about the READPREV results, then yes CICS will return to the program. If you are talking about a system limit being exceeded, then CICS will usually ABEND the program.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Sep 26, 2012 4:39 pm
Reply with quote

your program (in a loop) is issuing (executing) 100000 readprev.

upon a successful READPREV,
the RIDFLD is updated with the "id" of the current record.

apparently some compare is being made to the expected id
and the returned id.

now, we go back to a post I made earlier,
when the starting "key" is built, an ending key should also be built
otherwise you will never find an equal to the starting key
and keep reading until eof (start of file in this case).

you should also include a compare with the built key for out-of-range.

at some point you should realize that what you are looking for is not there,
and to continue reading will never result in a FOUND condition.

or you could simply implement a counter in your program
and at 99999 send a message back to the user,
not found and thus not issue the 100000th READPREV that would result in an abend.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts ABEND 0717 during starting IMS IMS DB/DC 0
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts how to complete the end of a record w... DFSORT/ICETOOL 2
Search our Forums:

Back to Top