QUIKVSAM KSD99898 INVALID GET REQUEST AT END OF FILE
search cancel

QUIKVSAM KSD99898 INVALID GET REQUEST AT END OF FILE

book

Article ID: 269236

calendar_today

Updated On:

Products

Vision:Report

Issue/Introduction

Receive the following error message processing a VSAM KSDS: QUIKVSAM KSD99898 INVALID GET REQUEST AT END OF FILE using QUIKVSAM.

This error message occurs when the prior POINT or GET did not evaluate the VSAM return and error codes for an end of file.

Thus, the next GET reads beyond the “end of file” causing this error message.

Environment

Vision Report all releases

 

Resolution

In order to evaluate the VSAM return and error codes, a QUIKVSAM feedback area must be established:

Here is an example of a feedback area:

EQU  QV-FEEDBACK    WST401-413        /* QUIKVSAM FEEDBACK AREA 

EQU  QV-TYPE        WST401            /* TYPE FILE, 'K,E,R'     

EQU  QV-ACCESS      WST402            /* TYPE ACCESS            

EQU  QV-FILLER1     WST403            /* RESERVED               

EQU  QV-LRECL       WST404-407-B      /* RECORD LENGTH          

EQU  QV-VSAMRCEC    WST408-409-B      /* RC & EC                

EQU  QV-VSAMRC      WST408-B          /* RETURN CODE (RC)       

EQU  QV-VSAMEC      WST409-B          /* ERROR CODE             

EQU  QV-RBA         WST410-413-B      /* RBA

 

(Chapter 7 of the Vision Report Reference Guide (page 7-4) will provide the feedback area contents.

 

The QUIKVSAM feedback is established with either an

 

                OPEN function for read only mode:

 

                                CALL  QUIKVSAM  C'ARFILE  ' C'OPEN'  QV-FEEDBACK       /* FEEDBACK

Or with an

                OPTION function for update/insert mode:

                                CALL  QUIKVSAM  C'ARFILE  ' C'OPTION'  QV-FEEDBACK       /* FEEDBACK

 

The OPEN/OPTION function is established as the initial call to QUIKVSAM and should not be invoked multiple times.

      

When processing input files sequentially, that is, with a POINT/GET, the input file should be sorted in order to find all the records in a search.

Here is an example of a check on the Vsam feedback code.

CALL  QUIKVSAM  C'ARFILE  ' C'POINT'   INF1   C'KGE02'

IF QV-VSAMRCEC  = X'0804'           /* NO RECORD FOUND

    GOTO 750.                        /* TELL USER THIS

750 MOVE C'POINT AT END OF FILE. KEY='   TO PRT1

    MOVE INF1-10      TO PRT28       /* KEY TO PRINT LINE

    PRINT                                    

    PRINTHEX QV-FEEDBACK                            

The X’0804’ is documented on page 7-4 of the Vision Reference Guide)

              VSAM Error Code (EC) X’04’ = End of file Detected.

If an end of file is detected it could be an indication that your records are not sorted based on the search key.  In order to reposition the VSAM internal positional indicator to the beginning of the file, issue a QUIKVSAM TCLOSE (Page 7-27 of the Reference Guide) :

   CALL QUIKVSAM             C’ddname’                 C’TCLOSE’

Please be advised if you are using KGE, that is a generic search key, a record previously retrieved may be erroneously retrieved again.  The search should be using a KEQ.

It should be noted when using the QUIKVSAM READ function, you will always start over at the beginning of the file and typically, you are looking for an exact match of a key or data item (KEQ). You will use this function in most cases where the records in the input file are not pre-sorted. Otherwise, sequential processing with a POINT and GET is more efficient.