INFDS File Feedback Example
you can make the following entries:
- Specify the INFDS keyword on the file description specification with the name of the file information data structure
- Specify the file information data structure and the subfields you wish to use on a definition specification.
- Specify special keywords as the first keyword of a free-form subfield definition, or left-adjusted, in the FROM field (positions 26-32) on the definition specification, or specify the positions of the fields in the FROM field (position 26-32) and the TO field (position 33-39).
Figure 1. Example of Coding
DCL-F MYFILE DISK(*EXT) INFDS(FILEFBK);
DCL-DS FILEFBK;
FILE *FILE; // File name
OPEN_IND IND POS(9); // File open?
EOF_IND IND POS(10: // File at eof?
STATUS *STATUS; // Status code
OPCODE *OPCODE; // Last opcode
ROUTINE *ROUTINE; // RPG Routine
LIST_NUM CHAR(8) POS(30); // Listing line
SPCL_STAT ZONED(5) POS(38); // SPECIAL status
RECORD *RECORD; // Record name
MSGID CHAR(7) POS(46); // Error MSGID
SCREEN *SIZE; // Screen size
NLS_IN *INP; // NLS Input?
NLS_OUT *OUT; // NLS Output?
NLS_MODE *MODE; // NLS Mode?
END-DS;
Figure 2. Example of Coding
FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++++++Comments++++++++++
FMYFILE IF E DISK INFDS(FILEFBK)
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++Comments++++++++++
DFILEFBK DS
D FILE *FILE * File name
D OPEN_IND 9 9N * File open?
D EOF_IND 10 10N * File at eof?
D STATUS *STATUS * Status code
D OPCODE *OPCODE * Last opcode
D ROUTINE *ROUTINE * RPG Routine
D LIST_NUM 30 37 * Listing line
D SPCL_STAT 38 42S 0 * SPECIAL status
D RECORD *RECORD * Record name
D MSGID 46 52 * Error MSGID
D SCREEN *SIZE * Screen size
D NLS_IN *INP * NLS Input?
D NLS_OUT *OUT * NLS Output?
D NLS_MODE *MODE * NLS Mode?
Note: The keywords are not labels and cannot be used to access the subfields. Short entries are padded on the right with blanks.