INFDS Get Attributes Feedback Example
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 to determine which fields you wish to include in the INFDS. To calculate the starting position and length of use the Offset, Data Type, and Length given in the IBM i documentation and do the following calculations:
Start = 241 + Offset
Character_Length = Length (in bytes)For example, for device type of a file, the IBM i documentation gives:
Offset = 31
Data Type is character
Length = 6Therefore,
Start = 241 + 31 = 272
See subfield DEV_TYPE in the example below.
Figure 1. Example of Coding
DCL-F MYFILE WORKSTN INFDS(DSPATRFBK);
DCL-DS DSPATRFBK;
PGM_DEV CHAR(10) POS(241); // Program device
DEV_DSC CHAR(10) POS(251); // Dev description
USER_ID CHAR(10) POS(261); // User ID
DEV_CLASS CHAR(1) POS(271); // Device class
DEV_TYPE CHAR(6) POS(272); // Device type
REQ_DEV CHAR(1) POS(278); // Requester?
ACQ_STAT CHAR(1) POS(279); // Acquire status
INV_STAT CHAR(1) POS(280); // Invite status
DATA_AVAIL CHAR(1) POS(281); // Data available
NUM_ROWS INT(5) POS(282); // Number of rows
NUM_COLS INT(5) POS(284); // Number of cols
BLINK CHAR(1) POS(286); // Allow blink?
LINE_STAT CHAR(1) POS(287); // Online/offline?
DSP_LOC CHAR(1) POS(288); // Display location
DSP_TYPE CHAR(1) POS(289); // Display type
KBD_TYPE CHAR(1) POS(290); // Keyboard type
CTL_INFO CHAR(1) POS(342); // Controller info
COLOR_DSP CHAR(1) POS(343); // Color capable?
GRID_DSP CHAR(1) POS(344); // Grid line dsp?
// The following fields apply to ISDN.
ISDN_LEN INT(5) POS(385); // Rmt number len
ISDN_TYPE CHAR(2) POS(387); // Rmt number type
ISDN_PLAN CHAR(2) POS(389); // Rmt number plan
ISDN_NUM CHAR(40) POS(391); // Rmt number
ISDN_SLEN INT(5) POS(435); // Rmt sub-address length
ISDN_STYPE CHAR(2) POS(437); // Rmt sub-address type
ISDN_SNUM CHAR(40) POS(439); // Rmt sub-address
ISDN_CON CHAR(1) POS(480); // Connection
ISDN_RLEN INT(5) POS(481); // Rmt address len
ISDN_RNUM CHAR(32) POS(483); // Rmt address
ISDN_ELEN INT(5) POS(519); // Extension len
ISDN_ETYPE CHAR(1) POS(521); // Extension type
ISDN_ENUM CHAR(40) POS(522); // Extension num
ISDN_XTYPE CHAR(1) POS(566); // X.25 call type
END-DS;
Figure 2. Example of Coding
DCL-F MYFILE WORKSTN INFDS(ICFATRFBK);
DCL-DS ICFATRFBK;
PGM_DEV CHAR(10) POS(241); // Program device
DEV_DSC CHAR(10) POS(251); // Dev description
USER_ID CHAR(10) POS(261); // User ID
DEV_CLASS CHAR(1) POS(271); // Device class
DEV_TYPE CHAR(1) POS(272); // Device type
REQ_DEV CHAR(1) POS(278); // Requester?
ACQ_STAT CHAR(1) POS(279); // Acquire status
INV_STAT CHAR(1) POS(280); // Invite status
DATA_AVAIL CHAR(1) POS(281); // Data available
SES_STAT CHAR(1) POS(291); // Session status
SYNC_LVL CHAR(1) POS(292); // Synch level
CONV_TYPE CHAR(1) POS(293); // Conversation typ
RMT_LOC CHAR(10) POS(294); // Remote location
LCL_LU CHAR(8) POS(302); // Local LU name
LCL_NETID CHAR(8) POS(310); // Local net ID
RMT_LU CHAR(8) POS(318); // Remote LU
RMT_NETID CHAR(8) POS(326); // Remote net ID
APPC_MODE CHAR(8) POS(334); // APPC Mode
LU6_STATE CHAR(1) POS(345); // LU6 conv state
LU6_COR CHAR(8) POS(346); // LU6 conv correlator
// The following fields apply to ISDN.
ISDN_LEN INT(5) POS(385); // Rmt number len
ISDN_TYPE CHAR(2) POS(387); // Rmt number type
ISDN_PLAN CHAR(2) POS(389); // Rmt number plan
ISDN_NUM CHAR(40) POS(391); // Rmt number
ISDN_SLEN INT(5) POS(435); // sub-addr len
ISDN_STYPE CHAR(2) POS(437); // sub-addr type
ISDN_SNUM CHAR(40) POS(439); // Rmt sub-address
ISDN_CON CHAR(1) POS(480); // Connection
ISDN_RLEN INT(5) POS(481); // Rmt address len
ISDN_RNUM CHAR(32) POS(483); // Rmt address
ISDN_ELEN CHAR(2) POS(519); // Extension len
ISDN_ETYPE CHAR(1) POS(521); // Extension type
ISDN_ENUM CHAR(40) POS(522); // Extension num
ISDN_XTYPE CHAR(1) POS(566); // X.25 call type
// The following information is available only when program was started
// as result of a received program start request. (P_ stands for protected)
TRAN_PGM CHAR(64) POS(567); // Trans pgm name
P_LUWIDLN CHAR(1) POS(631); // LUWID fld len
P_LUNAMELN CHAR(1) POS(632); // LU-NAME len
P_LUNAME CHAR(17) POS(633); // LU-NAME
P_LUWIDIN CHAR(6) POS(650); // LUWID instance
P_LUWIDSEQ INT(5) POS(656); // LUWID seq num
// The following information is available only when a protected conversation
// is started on a remote system. (U_ stands for unprotected)
U_LUWIDLN CHAR(1) POS(658); // LUWID fld len
U_LUNAMELN CHAR(1) POS(659); // LU-NAME len
U_LUNAME CHAR(17) POS(660); // LU-NAME
U_LUWIDIN CHAR(6) POS(677); // LUWID instance
U_LUWIDSEQ INT(5) POS(683); // LUWID seq num
END-DS;