File Feedback Information

The file feedback information starts in position 1 and ends in position 80 in the file information data structure. The file feedback information contains data about the file which is specific to RPG. This includes information about the error/exception that identifies:
  • The name of the file for which the exception/error occurred
  • The record being processed when the exception/error occurred or the record that caused the exception/error
  • The last operation being processed when the exception/error occurred
  • The status code
  • The RPG IV routine in which the exception/error occurred.

The fields from position 1 to position 66 in the file feedback section of the INFDS are always provided and updated even if INFDS is not specified in the program. The fields from position 67 to position 80 of the file feedback section of the INFDS are only updated after a POST operation to a specific device.

If INFDS is not specified, the information in the file feedback section of the INFDS can be output using the DUMP operation. For more information see DUMP (Program Dump).

Overwriting the file feedback section of the INFDS may cause unexpected results in subsequent error handling and is not recommended.

The location of some of the more commonly used subfields in the file feedback section of the INFDS is defined by special keywords. The contents of the file feedback section of the INFDS along with the special keywords and their descriptions can be found in the following tables:

Table 1. Contents of the File Feedback Information Available in the File Information Data Structure (INFDS)
From
(Pos.
26-32)
To
(Pos.
33-39)
 
Format
 
Length
 
Keyword
 
Information
1 8 Character 8 *FILE The first 8 characters of the file name.
9 9 Character 1   Open indication (1 = open).
10 10 Character 1   End of file (1 = end of file)
11 15 Zoned decimal 5,0 *STATUS Status code. For a description of these codes, see File Status Codes.
16 21 Character 6 *OPCODE Operation code The first five positions (left-adjusted) specify the type of operation by using the character representation of the calculation operation codes. For example, if a READE was being processed, READE is placed in the leftmost five positions. If the operation was an implicit operation (for example, a primary file read or update on the output specifications), the equivalent operation code is generated (such as READ or UPDAT) and placed in location *OPCODE. Operation codes which have 6 letter names will be shortened to 5 letters.
DELETE
DELET
EXCEPT
EXCPT
READPE
REDPE
UNLOCK
UNLCK
UPDATE
UPDAT
The remaining position contains one of the following:
F
The last operation was specified for a file name.
R
The last operation was specified for a record.
I
The last operation was an implicit file operation.
22 29 Character 8 *ROUTINE First 8 characters of the name of the routine (including a subprocedure) in which the file operation was done.
30 37 Character 8   If OPTION(*NOSRCSTMT) is specified, this is the source listing line number of the file operation. If OPTION(*SRCSTMT) is specified, this is the source listing statement number of the file operation. The full statement number is included when it applies to the root source member. If the statement number is greater than 6 digits, that is, it includes a source ID other than zero, the first 2 positions of the 8-byte feedback area will have a "+ " indicating that the rest of the statement number is stored in positions 53-54.
38 42 Zoned decimal 5,0   User-specified reason for error on SPECIAL file.
38 45 Character 8 *RECORD For a program described file the record identifying indicator is placed left-adjusted in the field; the remaining six positions are filled with blanks. For an externally described file, the first 8 characters of the name of the record being processed when the exception/error occurred.
46 52 Character 7   Machine or system message number.
53 66 Character 14   Unused.
77 78 Binary 2   Source Id matching the statement number from positions 30-37.
Table 2. Contents of the File Feedback Information Available in the File-Information Data Structure (INFDS) Valid after a POST
From
(Pos.
26-32)
To
(Pos.
33-39)
 
Format
 
Length
 
Keyword
 
Information
67 70 Zoned decimal 4,0 *SIZE Screen size (product of the number of rows and the number of columns on the device screen).
71 72 Zoned decimal 2,0 *INP The display's keyboard type. Set to 00 if the keyboard is alphanumeric or katakana. Set to 10 if the keyboard is ideographic.
73 74 Zoned decimal 2,0 *OUT The display type. Set to 00 if the display is alphanumeric or katakana. Set to 10 if the display is ideographic. Set to 20 if the display is DBCS.
75 76 Zoned decimal 2,0 *MODE Always set to 00.