1.2.4.1 Data structure Definition for IMS/DB Plug-in
A pointer to DB PCB structure is passed from Tuxedo ART for IMS
servers to COBOL programs, and finally to db_entry()
of plug-in for IMS/DB. To enable the plug-in work properly, the DB
PCB structure should be filled in correctly before calling COBOL
program each. This section defines the detailed requirement
regarding how to fill in DB PCB.
The DB PCB structure example is shown in the following listing 2.
Listing DB PCB Structure
struct {
char dbname[8];
char seglevel[2];
char stat_code[2];
char opt[4];
char res[4];
char segname[8];
char keylen[4];
char segnum[4];
char keyfa[IMS_FEEDAREA_LEN];
};
-
dbname: If the PCB statement in PSB contains a
PROCSEQ= <name>
, populate dbname with<name>
. Otherwise, populatedbname
with the name inNAME= <name>
from PSB. - seglevel: Populate with NULL
- stat_code: Populate with spaces
-
opt: Populate with value set to
PROCOPT
option from the PCB statement in PSB - res: Do not populate with anything
- segname: Populate with NULL
- keylen: Do not populate with anything
- segnum:Do not populate with anything
- keyfa: Populate with NULL
The following listing 3 shows the structure definition used for
the get_dbpcbattr
interface. The content is read from
the PSB
file and returned to application through
get_dbpcbattr
interface.
Listing Structure Definition Used for the get_dbpcbattr Interface
enum PCBTYPE {IOPCB = 1, ALTPCB = 2, GSAMPCB = 3, DBPCB = 4};
enum SEQUENTIALBUFFERING {NO = 1, COND = 2};
enum PCBPOS {SINGLE = 1, MULTIPLE = 2};
enum SENSITIVITY {READ = 1, UPDATE = 2};
struct __SENFLD {
char name[8]; /* mandatory, less than 8 filled with blank */
unsigned short start;/* mandatory, range [1-32767] */
int replace; /* optional, default is 1 */
};
struct SSPTR {
unsigned short pointer; /* range[1-8], default 0 */
enum SENSITIVITY sens;
};
struct __SENSEG {
char segname[8]; /* mandatory, less than 8 filled with blank */
char parent[8]; /* mandatory, less than 8 filled with blank */
char procopt[4]; /* optional, default filled with blank */
SSPTR ssptr[8]; /* each slot contains a subset pointer number and
associated sensitivity, pointer of 0 indicates end, totally up to 8 can be
specified */
char indices[8]; /* optional, default filled with blank */
SENFLD * senfld; /* optional, default is NULL */
unsigned short senfld_num; /* optional, default is 0, up to 255
SENFLD can be defined for each SENSEG */
};
struct __DB_PCB_ATTR { /* PCB Attributes */
enum PCBTYPE type; /* mandatory */
char dbname[8]; /* db name, default filled with blank */
char pcbname[8]; /* pcb name, optional, default filled with blank */
char procopt[4]; /* procopt , default filled with blank */
enum SEQUENTIALBUFFERING sb; /* optional, default is NO */
enum PCBPOS pos; /* optional, default is SINGLE */
int keylen; /* optional, default is invalid value 0 */
char procseq[8]; /* optional, default filled with blank */
int msdb_commit; /* optional, default is 0 */
int list; /* optional, default is 1 */
char *areas; /* area list set by SETR in DFSCTL, no change will be
applied on it in ART/IMS */
int senseg_num; /* optional, default is 0 */
struct SENSEG * senseg; /* optional, default is NULL */
};