Major and minor return codes in files by the system

 

Major and minor return codes report errors and certain status information for ICF, display, and printer files. They are not used for other files. They typically appear as four characters: the first two refer to the major code and the second two refer to the minor code.

The major code indicates the general type of error, and the minor provides further detail. Minor codes, except zero, have the same or a similar meaning, regardless of the major code with which they are combined.

The application program can test the return code after each I/O operation. If the major return code is 00, the operation completed successfully and the minor return code contains status information that indicates whether a read or a write operation should be performed next. A major return code of 04 or higher indicates that an error occurred. The program can test for any specific errors for which it will attempt programmed recovery. The application program can test for a specific condition by comparing the major and minor codes as a unit, or can identify a class of conditions by testing the major code alone.

Most major and minor return codes are accompanied by any one of several message numbers, for which the typical recovery action is similar. The individual languages file status codes; they can set based on the major and minor return codes.

Table 1 defines the major return codes. See the Application Display Programming

Link to PDF book for specific definitions of the major and minor return codes as they are used for display files and the message numbers associated with each. Similar specific definitions for printer files and each of the communications types valid on an ICF file can be found in the Printing topic and the books for each communications type.

Table 1. Major return code definitions. The major return codes and their definitions are outlined.
Code Definition
00 The operation requested by your program completed successfully. The minor includes state information, such as change direction.
   
02 Input operation completed successfully, but job is being ended (controlled). The minor includes state information.
   
03 Successful input operation, but no data was received. The minor includes state information.
   
04 Error occurred because an output operation was attempted while data was waiting to be read.
   
08 An acquire operation failed because the device has already been acquired or the session has already been established.
   
11 A read-from-invited-program-devices operation failed because no device or session was invited.
   
34 An input exception occurred. The data length or record format was not acceptable for the program.
   
80 A permanent (unrecoverable) system or file error occurred. Programmer action is required to correct the problem.
   
81 A permanent (unrecoverable) device or session error occurred during an I/O operation.
   
82 A device or session error occurred during an open or acquire operation. Recovery might be possible.
   
83 A device or session error occurred during an I/O operation. Recovery might be possible.

 

Parent topic:

Troubleshooting database file management

 

Related information

Application Display Programming PDF
Printing