INFDS Open Feedback Example
INFDS Open Feedback Example
To specify an INFDS which contains fields in the open feedback section, 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.
-
Use information in the IBM i documentation database and file systems category to determine which fields you wish to include in the INFDS. To calculate the starting position and length of the subfields of the open feedback section of the INFDS, use the Offset, Data Type, and Length given in the IBM i documentation and do the following calculations:
Start = 81 + Offset
Character_Length = Length (in bytes)For example, for overflow line number of a printer file, the IBM i documentation gives:
Offset = 107
Data Type is binary
Length = 2 bytesTherefore,
Start = 81 + 107 = 188
RPG data type is integer
Length = 5 digitsSee subfield OVERFLOW in the example below.
Figure 1. Example of Coding an INFDS with Open Feedback Information
DCL-F MYFILE PRINTER(132) INFDS(OPNFBK);
DCL-DS OPNFBK;
ODP_TYPE CHAR(2) POS(81); // ODP Type
FILE_NAME CHAR(10) POS(83); // File name
LIBRARY CHAR(10) POS(93); // Library name
SPOOL_FILE CHAR(10) POS(103); // Spool file name
SPOOL_LIB CHAR(10) POS(113); // Spool file lib
SPOOL_NUM_OLD INT(5) POS(123); // Spool file num
RCD_LEN INT(5) POS(125); // Max record len
KEY_LEN INT(5) POS(127); // Max key len
MEMBER CHAR(10) POS(129); // Member name
TYPE INT(5) POS(147); // File type
ROWS INT(5) POS(152); // Num PRT/DSP rows
COLUMNS INT(5) POS(154); // Num PRT/DSP cols
NUM_RCDS INT(10) POS(156); // Num of records
SPOOL_NUM INT(10) POS(160); // 6 digit Spool Nbr
ACC_TYPE CHAR(2) POS(160); // Access type
DUP_KEY CHAR(1) POS(162); // Duplicate key?
SRC_FILE CHAR(1) POS(163); // Source file?
VOL_OFF INT(5) POS(184); // Vol label offset
BLK_RCDS INT(5) POS(186); // Max rcds in blk
OVERFLOW INT(5) POS(188); // Overflow line
BLK_INCR INT(5) POS(190); // Blk increment
FLAGS1 CHAR(1) POS(196); // Misc flags
REQUESTER CHAR(10) POS(197); // Requester name
OPEN_COUNT INT(5) POS(207); // Open count
BASED_MBRS INT(5) POS(211); // Num based mbrs
FLAGS2 CHAR(1) POS(213); // Misc flags
OPEN_ID CHAR(2) POS(214); // Open identifier
RCDFMT_LEN INT(5) POS(216); // Max rcd fmt len
CCSID INT(5) POS(218); // Database CCSID
FLAGS3 CHAR(1) POS(220); // Misc flags
NUM_DEVS INT(5) POS(227); // Num devs defined
END-DS;