bdfp1m0iProgramming Concepts and Reference


Identifying Return Indicators and Errors

After you call a macro or function, the TPFDF product indicates the success or failure of the call by setting indicator bits in the SW00RTN field in the SW00SR slot for that subfile. The SW00RT1 and SW00RT2 fields provide additional information about error conditions.

When a macro or function ends successfully, the TPFDF product sets SW00RTN to zero and the application program continues normally.

Table 3 shows the SW00RTN and SW00RT2 settings that indicate the application program must take some remedial action.

Table 3. Error Conditions

SW00SR Error Bits Condition
SW00RTN #BIT1 One of the following:
  • The logical record (LREC) was not found when using a DBRED macro, dfred function, DBDEL macro, or dfdel function.
  • An LREC was found with the same keys as the LREC being added by one of the following:
    • DBADD macro with the UNIQUE parameter specified
    • dfadd function with the DFADD_UNIQUE value specified for the options parameter
    • DBADD macro or dfadd function for a file with UNIQUE=YES specified on the DBDEF macro for the file.
SW00RTN #BIT5 End of file occurred during fullfile processing.
SW00RT2 #BIT0 Error in list of logical record numbers. This bit is only meaningful if bit 1 in SW00RTN is ON.
SW00RT2 #BIT5 The subfile is empty because of the following:
  • The next available byte (NAB) value in the prime block indicates the first byte directly after the header.
  • There are no forward chains in the prime block.

Table 4 shows the SW00RTN and SW00RT2 settings that indicate more serious errors. The TPFDF product may issue a system error when one of these errors occur.

Table 4. Serious Errors

SW00SR Error Bits Condition
SW00RTN #BIT0 I/O or B+Tree index error.
SW00RTN #BIT2 File address compute program (FACE) error.
SW00RTN #BIT3 One of the following:
  • Subfile does not exist in detail file or intermediate index file.
  • Incorrect algorithm argument.
SW00RTN #BIT4 Data in block is corrupt.
SW00RTN #BIT6 Sequence error using a DBRST macro or dfrst function.
SW00RTN #BIT7 Sort or merge error.
SW00RT2 #BIT1 Error with the DBDSP macro or dfdsp function.
SW00RT2 #BIT4 B+Tree index error.

When you use fullfile processing, SW00RT1 contains the number of errors detected since the file was opened.