Structure of the initialization file

The initialization file consists of three types of section: common section, subsystem section, and data source sections.

The three sections, which are also called stanzas, are described as follows:
Common section
Contains parameters that are global to all applications using this initialization file.
Subsystem section
Contains parameter values unique to that subsystem.
Data source sections
Contain parameter values to be used only when connected to that data source. You can specify zero or more data source sections.

Each section is identified by a syntactic identifier enclosed in square brackets.

The syntactic identifier is either the literal 'common', the subsystem ID or the data source (location name). For example:
[data-source-name]
This is the section header.
The parameters are set by specifying a keyword with its associated keyword value in the form:
KeywordName =keywordValue
  • All the keywords and their associated values for each data source must be located below the data source section header.
  • The keyword settings in each section apply only to the data source name in that section header.
  • The keywords are not case sensitive; however, their values can be if the values are character based.
  • If a data source name is not found in the Db2 ODBC initialization file, the default values for these keywords are in effect.
  • Comment lines are introduced by having a semicolon in the first position of a new line.
  • Blank lines are also permitted. If duplicate entries for a keyword exist, the first entry is used (and no warning is given).
Important: You can avoid common errors by ensuring that the following contents of the initialization file are accurate:
  • Square brackets: The square brackets in the initialization file must consist of the correct EBCDIC characters. The open square bracket must use the hexadecimal characters X'AD'. The close square bracket must use the hexadecimal characters X'BD'. Db2 ODBC does not recognize brackets if coded differently.
  • Sequence numbers: The initialization file cannot accept sequence numbers. All sequence numbers must be removed.
The following sample is a Db2 ODBC initialization file with a common stanza, a subsystem stanza, and two data source stanzas.
; This is a comment line...
; Example COMMON stanza
[COMMON]
MVSDEFAULTSSID=VD1A
CONNECTTYPE=2
; Example SUBSYSTEM stanza for VD1A subsystem
[V81A]
MVSATTACHTYPE=CAF
PLANNAME=DSNACLI
; Example DATA SOURCE stanza for STLEC1 data source
[STLEC1]
AUTOCOMMIT=0
; Example DATA SOURCE stanza for STLEC1B data source
[STLEC1B]
CURSORHOLD=0