INFDS Device Specific Feedback Examples

To specify an INFDS which contains fields in the device-specific 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 Information Center to determine which fields you wish to include in the INFDS. To calculate the starting position and length of the subfields of the input/output feedback section of the INFDS, use the Offset, Data Type, and Length given in the Information Center and do the following calculations:

       Start = 367 + Offset
       Character_Length = Length (in bytes)

    For example, for the relative record number of a data base file, the Information Center gives:


       Offset = 30
       Data Type is binary
       Length = 4

    Therefore,


       Start = 367 + 30 = 397
       RPG data type is integer
       Length = 10 digits

    See subfield DB_RRN in DBFBK data structure in the example below.

Figure 1. Example of Coding an INFDS with Printer Specific Feedback Information

   DCL-F MYFILE PRINTER(132) INFDS(PRTFBK);

   DCL-DS PRTFBK;
     CUR_LINE      INT(5)     POS(367);    // Current line num
     CUR_PAGE      INT(10)    POS(369);    // Current page cnt
     // If the first bit of PRT_FLAGS is on, the spooled file has been
     // deleted.  Use TESTB X'80' or TESTB '0' to test this bit.
     PRT_FLAGS     CHAR(1)    POS(373);    // Print Flags
     PRT_MAJOR     CHAR(2)    POS(401);    // Major ret code
     PRT_MINOR     CHAR(2)    POS(403);    // Minor ret code
   END-DS;
Figure 2. Example of Coding an INFDS with Database Specific Feedback Information

   DCL-F MYFILE DISK(*EXT) INFDS(DBFBK);

   DCL-DS DBFBK;
     FDBK_SIZE     INT(10)    POS(367);    // Current line num
     JOIN_BITS     INT(10)    POS(371);    // JFILE bits
     LOCK_RCDS     INT(5)     POS(377);    // Nbr locked rcds
     POS_BITS      CHAR(1)    POS(385);    // File pos bits
     DLT_BITS      CHAR(1)    POS(384);    // Rcd deleted bits
     NUM_KEYS      INT(5)     POS(387);    // Num keys (bin)
     KEY_LEN       INT(5)     POS(393);    // Key length
     MBR_NUM       INT(5)     POS(395);    // Member number
     DB_RRN        INT(10)    POS(397);    // Relative-rcd-num
     KEY           CHAR(2000) POS(401);    // Key value (max size 2000)
   END-DS;
Figure 3. Example of Coding an INFDS with ICF Specific Feedback Information

   DCL-F MYFILE WORKSTN(*EXT) INFDS(ICFFBK);

   DCL-DS ICFFBK;
     ICF_AID       CHAR(1)    POS(369);    // AID byte
     ICF_LEN       INT(10)    POS(372);    // Actual data len
     ICF_MAJOR     CHAR(2)    POS(401);    // Major ret code
     ICF_MINOR     CHAR(2)    POS(403);    // Minor ret code
     SNA_SENSE     CHAR(8)    POS(405);    // SNA sense rc
     SAFE_IND      CHAR(1)    POS(413);    // Safe indicator
     RQSWRT        CHAR(1)    POS(415);    // Request write
     RMT_FMT       CHAR(10)   POS(416);    // Remote rcd fmt
     ICF_MODE      CHAR(8)    POS(430);    // Mode name
   END-DS;
Figure 4. Example of Coding an INFDS with Display Specific Feedback Information

   DCL-F MYFILE WORKSTN(*EXT) INFDS(DSPFBK);

   DCL-DS DSPFBK;
     DSP_FLAG1     CHAR(2)    POS(367);    // Display flags
     DSP_AID       CHAR(1)    POS(369);    // AID byte
     CURSOR        CHAR(2)    POS(370);    // Cursor location
     DATA_LEN      INT(10)    POS(372);    // Actual data len
     SF_RRN        INT(5)     POS(376);    // Subfile rrn
     MIN_RRN       INT(5)     POS(378);    // Subfile min rrn
     NUM_RCDS      INT(5)     POS(380);    // Subfile num rcds
     ACT_CURS      CHAR(2)    POS(382);    // Active window cursor location
     DSP_MAJOR     CHAR(2)    POS(401);    // Major ret code
     DSP_MINOR     CHAR(2)    POS(403);    // Minor ret code
   END-DS;