The server assigns several rather specific major return codes such as 02, 03, 0309, and so on to conditions for which a specific response from the application program is appropriate.
A major return code of 02 indicates that the requested input operation completed successfully, but the server is ending the job in a controlled. The application program should complete its processing as quickly as possible. The controlled cancel is intended to allow programs time to end in an orderly manner. If your program does not end within the time specified on the ENDJOB command, the server will end the job without further notice.
A major return code of 03 indicates that an input operation completed successfully without transferring any data. For some applications, this might be an error condition, or it might be expected when the user presses a function key instead of entering data. It might also indicate that all the data has been processed, and the application program should proceed with its completion processing. In any case, the contents of the input buffer in the program should be ignored.
A major and minor code of 0309 indicates that the server received no data and is ending the job in a controlled manner. A major and minor code of 0310 indicates that there is no data because the specified wait time has ended. Other minor return codes accompanying the 02 or 03 major code are the same as for a 00 major code, indicating communications status and the operation to be performed next.
A major return code of 04 indicates that an output exception occurred. Specifically, your program attempted to send data when data should have been received. This is probably the result of not handling the minor return code properly on the previous successful completion. Your program can recover by just receiving the incoming data and then repeating the write operation.
A major return code of 34 indicates that an input exception occurred. The received data was either too long or incompatible with the record format. The minor return code indicates what was wrong with the received data, and whether the data was truncated or rejected. Your program can probably handle the exception and continue. If the data was rejected, you might be able to read it by specifying a different record format.
Two other return codes in this group, 0800 and 1100, are both typically the result of application programming errors, but are still recoverable. 0800 indicates that an acquire operation failed because the device has already been acquired or the session has already been established. 1100 indicates that the program attempted to read from invited devices with no devices invited. In both cases, the program ignored the request that is not valid, and the program can continue.
No message is issued with a 02 major code or most minor codes with the 03 major code, but the other exceptions in this group are typically accompanied by a message in the CPF4701-CPF47FF or CPF5001-CPF50FF range.