HPlogo KSAM/3000 Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 USING KSAM FILES IN COBOL PROGRAMS

STATUS

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

USING STATUS

The value of status can be tested as a whole, or the two characters can be tested separately as status-key-1 and status-key-2. In any case, the status of each call should be tested immediately following execution of the call. Unless the first character of status = "0", the call was not successful.

For example, a sample status parameter definition might be:

   WORKING-STORAGE SECTION. 

    . 

    . 

    . 

   01 STAT. 

      02 STATUS-KEY-1 PIC X. 

      02 STATUS-KEY-2 PIC X. 

These items can then be referenced in the PROCEDURE DIVISION. For example: to test only the first character:

   IF STATUS-KEY-1 NOT = "0" THEN 

       GO TO "ERROR-ROUTINE". 

To test the entire status word:

   IF STAT = "23" THEN 

        DISPLAY "RECORD NOT FOUND". 

Note that the word STATUS is reserved.

Feedback to webmaster