# DB2INFO

## Syntax:

    DB2INFO(function[,stemname])

## Arguments:

function
  describes the action you want to be performed. The valid values are:
  'DEFAULTS'
    specifies that certain DB2 default values are to be copied into special REXX variables (see "Returned Information" below).
  'LIST'
    specifies that the subsystem names of the currently installed DB2 subsystems are to be placed into the array named by stemname.

    Note: For the LIST function stemname MUST be specified.

stemname
  the name of the stem array that will contain the DB2 subsystem names. The combined lengths of the stemname argument and the largest subscript (including any periods) cannot exceed the REXX maximum length for symbols (250 characters). If stemname is to be a true REXX stem, code a period (.) as the last character. If you do not specify the period, the subscripts will abut the stem name without an intervening period. For example, if you specify a stemname of "ABC.", DB2INFO will create variables of the form "ABC.1", "ABC.2", "ABC.3", etc. If you specify a stemname of "ABC" (no period), DB2INFO will create variables of the form "ABC1", "ABC2", "ABC3", etc.

## Module Name:

SWXDBIF

## Component:

Dynamic DB2/SQL Service

## Service Description:

The DB2INFO function is used to retrieve information about the DB2 subsystems that are currently installed on your system. The LIST function will provide you with an array of subsystem names. You may use these names for the subsystem name argument of the DSNALI function.

Note: If a DB2 subsystem has been created, but: a) its address spaces are not active, and b) no IPL has been taken since the subsystem was created, that subsystem will not be listed.

The DEFAULTS function retrieves default values from the DSNHDECP module which is created when DB2 is installed. For more information regarding the default values of DSNHDECP refer to the DB2 Administration Guide.

## Returned Information:

The DB2INFO function returns a return code that indicates the success of the operation. If you CALL the DB2INFO function, the returned value is contained in the RESULT special variable.

For LIST function calls, if DB2 subsystems are found they will be returned in stemname variables. The zeroth element of the stemname array contains the number of stemname variables created.

The RC special variable is set to contain the DB2INFO return code. The following DB2INFO RC values are possible:

0
  The operation was successful.
4
  For the LIST function only, no DB2 subsystems were found.
8
  For the DEFAULT function only, the DSNHDECP module could not be loaded. Usually error messages will accompany this return code.

For successful DEFAULTS function calls, the following REXX variables are set:

$SWXDB2_LVL
  Contains the DB2 version code.
$SWXDB2_SSID
  Contains the default DB2 subsystem name.
$SWXDB2_CHAR
  Contains the default character set name (currently either ALPHANUM or KATAKANA).
$SWXDB2_DATE
  Contains the default date type (ISO, JIS, EUR, USA, or LOCAL).
$SWXDB2_TIME
  Contains the default time type (ISO, JIS, EUR, USA, or LOCAL).

## Examples:

1. List the currently installed DB2 subsystems:

       call db2info 'list', 'abc.'
       do i = 1 to abc.0
         say abc.i
       end

2. Retrieve the current DB2 default values:

       call db2info 'defaults'

© Copyright 1998 by Open Software Technologies, Inc.