To access DB2® files from a COBOL application that runs under AIX®, you must follow guidelines for compiling and linking the application and for identifying the DB2 file system, the DB2 instance and database, and the DB2 files.
. /home/db2inst1/sqllib/db2profile
> db2 connect to db2cob
Database Connection Information
Database server = DB2/AIX64 9.7.0
SQL authorization ID = MYUID
Local database alias = DB2COB
export DB2DBDFT=db2cob
export TRANFILE=DB2-TEST.TRANS
Creating DB2 files:
For more information about the cicsddt command, see the TXSeries Knowledge Center referenced below.
db2 create table cics.example\
"(rba char(4) not null for bit data, f1 varchar(80) not null for bit data)"
db2 create unique index cics.example0 on cics.example\
"(rba) disallow reverse scans"
db2 create unique index cics.example0@ on cics.example\
"(rba desc) disallow reverse scans"
> db2 describe table cics.example
Data type Column
Column name schema Data type name Length Scale Nulls
------------------------ --------- ------------------- ---------- ----- ------
RBA SYSIBM CHARACTER 4 0 No
F1 SYSIBM VARCHAR 80 0 No
2 record(s) selected.
The file CICS.EXAMPLE has variable-length records that would be compatible with a COBOL FILE SECTION definition of minimum record length between 0 and 79.
For more information about the functions that are provided by the db2 utility, enter the command db2.
For information about the additional requirements that apply to using DB2 files with CICS® TXSeries, see the related reference about the DB2 file system.