DBB environment variables

In order to use Dependency Based Build, a number of environment variables to be set before any builds can be executed.

DBB required environment variables

These variables are always required to be set:

  • DBB_HOME - The location of the DBB intallation directory.
  • DBB_CONF - The location of the DBB configuration directory. By default it is set to $DBB_HOME/conf. However, you might want to copy the directory contents to a writable location like etc/dbb and the set the environment variable to that location.

Example:

# DBB required variables
export DBB_HOME=/usr/lpp/IBM/dbb
export DBB_CONF=/etc/dbb

DBB CLI

In order to use the CLI it is required to add $DBB_HOME/bin to the PATH environment.

Example:

# Add $DBB_HOME/bin to the path (required for DBB CLI)
export PATH="${DBB_HOME}/bin:$PATH"

DBB zBuilder

DBB 3.0 introduces an integrated build framework called the zBuilder. Part of zBuilder setup is to copy the $DBB_HOME/build directory to an alternate location such as /etc/dbb/build so that zBuilder YAML configuration files are not overwritten when new versions of DBB is installed. Customers using the zBuilder must set variable DBB_BUILD. Example:

# zBuilder configuration directory
export DBB_BUILD=/etc/dbb/build

IBM Db2 support

When using Db2 as the metadata store implementation, the Db2 JDBC driver and license JAR file must be added to the CLASSPATH environment variable. For a local Db2 for Z, you can directly reference the Db2 installation. For Db2 for LUW or a remote Db2 for Z, you need to copy the JDBC driver and license JAR files to a local directory. Example:

# Add Db2 JDBC Driver Jar Files to CLASSPATH
export CLASSPATH=/usr/lpp/db2c10/jdbc/classes/db2jcc4.jar:/usr/lpp/db2c10/jdbc/classes/db2jcc_license_cisuz.jar:$CLASSPATH

Db2 JDBC type 2 connection

A Db2 JDBC type 2 connection can be used to create a connection to a local Db2 instance running on the same LPAR. In addition to the CLASSPATH modification discussed above, you also need to modify the STEPLIB and LIBPATH environment variables to create a Type 2 connection. Example:

# Db2 Data Server Driver variables required for Type 2 local connections
export STEPLIB=DSNC10.SDSNEXIT:DSNC10.SDSNLOAD:DSNC10.SDSNLOD2:$STEPLIB
export LIBPATH=/usr/lpp/db2c10/jdbc/lib:$LIBPATH

Setting DBB environment variables

You can configure these variables in the dbbenv.sh shell script located in the DBB installation directory under the /conf folder and then execute the shell script from either your z/OS Unix .profile script or as part of your CI/CD pipeline execution.

By default, DBB_HOME is set as /usr/lpp/IBM/dbb and DBB_CONF is set as /usr/lpp/IBM/dbb/conf in the dbbenv.sh file. All other environment variables discussed above are provided but are commented out and should be uncommented as needed. Ensure that all the values match your installation.

IDz DBB integration

DBB also provides the rse-dbb.env file in the DBB installation directory under the /conf folder. This file is used to provide the required DBB environment variables to the z/OS Explorer configuration. In addition to DBB_HOME and DBB_CONF environment variables, it also provides a DBB_JAVA_HOME environment variable. This variable is sometimes needed when the z/OS Explorer JAVA_HOME is set to a JVM that is incompatible with DBB. See the Prerequisites for more details about what versions of Java are supported for DBB.