DB2 file system

The DB2® file system supports sequential, indexed, and relative files. It provides enhanced interoperation with CICS® TXSeries, enabling batch COBOL programs to access CICS ESDS, KSDS, and RRDS files that are stored in DB2.

The implementation of the DB2 file system ensures that each COBOL operation is committed to the database so that no transactional or other database semantics show through to the COBOL program.

The DB2 database management system (DBMS) provides backup, compression, encryption, and utility functions, and also provides DB2 users with a familiar maintenance and administration protocol.

The db2 command-line utility provides administrative functions for DB2 files. For example, you might use the db2 describe command to print details about a file called CICS.Transaction.log in the DB2 file system:

> db2 describe table CICS.\"Transaction.log\"
                        Data type                    Column
Column name             schema    Data type name     Length   Scale Nulls
----------------------- --------- ------------------ -------- ----- ----
RBA                     SYSIBM    CHARACTER                8      0 No
F1                      SYSIBM    CHARACTER               41      0 No
F2                      SYSIBM    VARCHAR                 29      0 No

For more information about the functions that are provided by the db2 utility, enter the command db2.

The DB2 file system is nonhierarchical.

Restrictions:
  • A given program can use DB2 files in only one database.
  • The DB2 file system is not safe for use with multiple threads.

Interoperation with TXSeries:

For interoperation with TXSeries, there are additional requirements for DB2 files:
  • The schema name for the DB2 table must be CICS. Specify the fully-qualified name in one of these items:
    • The ASSIGN TO literal, for example, ASSIGN TO 'CICS.MYFILE'
    • The environment variable value, for example, export ENVAR=CICS.MYFILE
    • The ASSIGN USING data-name value, for example, MOVE 'CICS.MYFILE' TO fileData

    The rest of the file-name after the schema must be uppercase.

  • Fixed-length files have the following maximum record lengths:
    • Indexed (KSDS): 4005 bytes
    • Relative (RRDS): 4001 bytes
    • Sequential (ESDS): 4001 bytes
  • Files that have record lengths that are larger than the maximum record lengths for fixed-length files must be defined as variable length.
  • The maximum record length is 32,767 bytes.
  • If a DB2 file is created by a COBOL program, the runtime option FILEMODE(SMALL) must be in effect.

related concepts  
File organization and access mode

related references  
File-system summary  
Effect of CLOSE statement on file types (COBOL for AIX Language Reference)  
Compiler limits (COBOL for AIX Language Reference)  
DB2 Database Administration Concepts and Configuration Reference (SQL limits)