# DSNALI

## Syntax:

    DSNALI('OPEN',ssid,plan)

    DSNALI('CLOSE',option)

## Arguments:

ssid
  the 1 to 4 character DB2 subsystem name.
plan
  the 1 to 8 character name of the plan that will be used by this connection. The default Shadow REXXTOOLS plan for access with the isolation parameter of CS (cursor stability) is SDBC1010. The default Shadow REXXTOOLS plan for access with the isolation parameter of RR (repeatable read) is SDBR1010.
option
  describes how you want the current unit of work to be terminated. The valid values are:
  'SYNC'
    specifies that modifications made during the current unit of work are to be committed.
  'ABRT'
    specifies that modifications made during the current unit of work are to be discarded.

## Module Name:

SWXDSNAL

## Component:

Dynamic DB2/SQL Service

## Service Description:

The DSNALI function is used to allocate and de-allocate resources associated with a plan. A connection between the issuing task and DB2 is also established for OPEN calls. This connection is broken when a successful CLOSE call is issued or the task terminates.

Notes:

1. Open Software highly recommends the use of the DSNALI function in all environments.
2. If you do not explicitly call DSNALI before issuing an SQL command, a default plan and subsystem name will be used to implicitly establish the connection for you. The default plan and subsystem names are determined by the Shadow REXXTOOLS installer, or by the most recent OPTIONS command (using the SUBSYS and PLAN keywords).

## Returned Information:

The DSNALI function returns the decimal Call Attachment Facility (CAF) return code. If you CALL the DSNALI function, the returned value is contained in the RESULT special variable. The RC special variable is also set to contain the CAF return code. The REASON special variable is set to contain the CAF reason code in printable hexadecimal characters.

For a complete list of the CAF return and reason codes, refer to DB2 Messages and Codes for your system's level of DB2.

## Examples:

1. Open the Shadow REXXTOOLS plan for access with cursor stability for DB2 subsystem ABC:

       call dsnali 'open', 'abc', 'sdbc1010'
       say 'rc='rc 'reason='reason

2. Close the currently open plan and rollback any changes since the last commit point:

       call dsnali 'close', 'abrt'

© Copyright 1998 by Open Software Technologies, Inc.