File Management - IBM
File Management - IBM File Management - IBM
The open feedback area also contains information about each device or communications session that is defined for the file. v Input/output feedback area There are two sections of the I/O feedback area that are updated on the successful completion of input and output operations: – Common area This area contains information about I/O operations that were performed on the file. This includes the number of operations and the last operation performed. See “I/O feedback area” on page 179 for a complete list of the information that you can retrieve from the common I/O feedback area. – File-dependent feedback area This area contains file-specific information for display, database, printer, and ICF files; for example, the major and minor return code and amount of data received from the device. See “I/O feedback area for ICF and display files” on page 185, “I/O feedback area for printer files” on page 188, and “I/O feedback area for database files” on page 189 for a complete list of the information that you can retrieve from the file-dependent I/O feedback area. The above information areas can be useful to you. For example, when an error occurs with a device file, the program could determine predefined error handling operations based on the major/minor return code in the file-dependent feedback area. If data is being received from a communications device and the application on the other end sends an error, the program could determine that the next operation should be to wait until the next block of data is sent indicating the error. Possibly, the next operation may be to close the file and end the conversation with the application on the other side or wait for the next request from the application. Another way might include detecting the type of file that actually opened to determine the type of operations that are allowed. If the file type is printer, only output operations are allowed. File error detection and handling by the system 24 File Management V4R5 The system can detect errors when a file is opened, when a program device is acquired or released, during I/O operations to a file, and when the file is closed. When appropriate, the system will automatically try to run a failing operation again, up to a retry limit. When a retry is successful, neither operator nor program action is required. How the system reports errors: The system reports errors that can affect the processing of the program in any or all of the following ways: v A notify, status, diagnostic, or escape message may be sent to the program message queue of the program using the file. These messages may also appear in the job log, depending on the message logging level that is set for the job. See “Messages and message monitors in files by the system” on page 25 for more information. v The high-level language may return a file status code. v A major and minor return code is returned in the I/O feedback area for intersystem communications function (ICF), display, and printer files. See “Major and minor return codes in files by the system” on page 26 for more information.
v A notify, status, diagnostic, or escape message may be sent to the operator message queue (QSYSOPR) or the history message queue (QHST). v Information regarding the error may be saved in the system error log for use by the problem analysis and resolution programs. v An alert message may be sent to an operator at another system in the network. v The normal program flow may be interrupted and control may be transferred to an error-handling subroutine, or other language operations may occur. For additional information about how to handle run-time errors, see the appropriate book for the high-level language. Only some of these are significant to a program that is attempting error recovery. Actions to take when you receive an error: See “Recovering from file system errors” on page 28 for information on the actions you should take when you receive an error. Nonrecoverable errors: Not all file errors allow programmed error recovery. Some errors are permanent; that is, the file, device, or program cannot work until you take some corrective action. This might involve resetting the device by varying it off and on again, or correcting an error in the device configuration or the application program. Some messages and return codes inform the user or the application program of conditions that are information rather than errors, such as change in the status of a communications line, or system action taken for an unexpected condition. In many cases, it is possible for the application program to test for an error condition and take some preplanned recovery action which allows the program to continue without intervention from the operator. For more information: The CL Programming, SC41-5721-03 book discusses how to use the debug functions to resolve unexpected errors that you encounter in the application programs. The chapter on handling problems in the Basic System Operation, Administration, and Problem Handling, SC41-5206-04 book describes the programs that are available for analyzing and reporting system errors and hardware failures. Messages and message monitors in files by the system Displayed messages are the primary source of information for an operator or a programmer who is testing a new application. A message usually contains more specific information than the file status code, the indicators, and the major and minor return code. The control language lets you monitor messages so that the CL program can intercept a message and take corrective action. See the CL Programming, SC41-5721-03 book for more information about message types and message monitors. In most high-level languages, the file status code and return codes (which are described in the following section) are more convenient sources of information. Message numbers are assigned in categories to make it easier for a program to monitor for a group of related messages. Table 6 on page 26 shows the message number ranges that are assigned for file error messages. Chapter 2. File processing 25
- Page 1: AS/400e File Management Version 4
- Page 4 and 5: © Copyright International Business
- Page 6 and 7: | | | | | Special considerations fo
- Page 8 and 9: vi File Management V4R5
- Page 10 and 11: viii File Management V4R5
- Page 12 and 13: 2 File Management V4R5 v Distribute
- Page 14 and 15: Table 1. File Types and Their Main
- Page 16 and 17: Table 2. High-Level Languages and T
- Page 18 and 19: | | Table 3. High-Level Languages a
- Page 20 and 21: Add Add new records to the file. Up
- Page 22 and 23: | Sharing files 12 File Management
- Page 24 and 25: 14 File Management V4R5 For example
- Page 26 and 27: 16 File Management V4R5 File resour
- Page 28 and 29: 18 File Management V4R5 v “Displa
- Page 30 and 31: Application 1 Application 2 Applica
- Page 32 and 33: 22 File Management V4R5 LVLCHK(*NO)
- Page 36 and 37: 26 File Management V4R5 Table 6. OS
- Page 38 and 39: 28 File Management V4R5 Table 7. Ma
- Page 40 and 41: 30 File Management V4R5 Depending o
- Page 42 and 43: 32 File Management V4R5
- Page 44 and 45: 34 File Management V4R5 Handling ov
- Page 46 and 47: 36 File Management V4R5 output queu
- Page 48 and 49: 38 File Management V4R5 The followi
- Page 50 and 51: 40 File Management V4R5 application
- Page 52 and 53: 42 File Management V4R5 activation
- Page 54 and 55: Program A (in user default activati
- Page 56 and 57: 46 File Management V4R5 Override 1
- Page 58 and 59: 48 File Management V4R5 same call l
- Page 60 and 61: 50 File Management V4R5 Program A .
- Page 62 and 63: 52 File Management V4R5 Applying OV
- Page 64 and 65: Deleting overrides 54 File Manageme
- Page 66 and 67: Program A (in user default activati
- Page 68 and 69: 58 File Management V4R5 Displaying
- Page 70 and 71: 60 File Management V4R5 Command 7 d
- Page 72 and 73: 62 File Management V4R5 Display All
- Page 74 and 75: Redirecting files 64 File Managemen
- Page 76 and 77: 66 File Management V4R5 Default act
- Page 78 and 79: 68 File Management V4R5 From Databa
- Page 80 and 81: Copying files: overview 70 File Man
- Page 82 and 83: 72 File Management V4R5 Table 9. Co
v A notify, status, diagnostic, or escape message may be sent to the operator<br />
message queue (QSYSOPR) or the history message queue (QHST).<br />
v Information regarding the error may be saved in the system error log for use by<br />
the problem analysis and resolution programs.<br />
v An alert message may be sent to an operator at another system in the network.<br />
v The normal program flow may be interrupted and control may be transferred to<br />
an error-handling subroutine, or other language operations may occur. For<br />
additional information about how to handle run-time errors, see the appropriate<br />
book for the high-level language.<br />
Only some of these are significant to a program that is attempting error recovery.<br />
Actions to take when you receive an error:<br />
See “Recovering from file system errors” on page 28 for information on the actions<br />
you should take when you receive an error.<br />
Nonrecoverable errors:<br />
Not all file errors allow programmed error recovery. Some errors are permanent;<br />
that is, the file, device, or program cannot work until you take some corrective<br />
action. This might involve resetting the device by varying it off and on again, or<br />
correcting an error in the device configuration or the application program. Some<br />
messages and return codes inform the user or the application program of<br />
conditions that are information rather than errors, such as change in the status of a<br />
communications line, or system action taken for an unexpected condition. In many<br />
cases, it is possible for the application program to test for an error condition and<br />
take some preplanned recovery action which allows the program to continue<br />
without intervention from the operator.<br />
For more information:<br />
The CL Programming, SC41-5721-03 book discusses how to use the debug functions<br />
to resolve unexpected errors that you encounter in the application programs.<br />
The chapter on handling problems in the Basic System Operation, Administration, and<br />
Problem Handling, SC41-5206-04 book describes the programs that are available for<br />
analyzing and reporting system errors and hardware failures.<br />
Messages and message monitors in files by the system<br />
Displayed messages are the primary source of information for an operator or a<br />
programmer who is testing a new application. A message usually contains more<br />
specific information than the file status code, the indicators, and the major and<br />
minor return code. The control language lets you monitor messages so that the CL<br />
program can intercept a message and take corrective action. See the CL<br />
Programming, SC41-5721-03 book for more information about message types and<br />
message monitors. In most high-level languages, the file status code and return<br />
codes (which are described in the following section) are more convenient sources<br />
of information.<br />
Message numbers are assigned in categories to make it easier for a program to<br />
monitor for a group of related messages. Table 6 on page 26 shows the message<br />
number ranges that are assigned for file error messages.<br />
Chapter 2. <strong>File</strong> processing 25