CONNECTIONS

Property

Value

Kind

Connection library

Type

Integer

Read

Anytime

Write

Anytime

Default

1

Explanation

The CONNECTIONS library attribute specifies the number of connections this connection library is currently prepared to handle.

The maximum CONNECTIONS value that can be included in a connection library declaration is 1048575. If CONNECTIONS is assigned a larger value in the declaration, the compiler generates a syntax error.

However, it might be possible to assign CONNECTIONS a larger value in statements outside the declaration. The actual maximum value is machine-dependent, and corresponds to the maximum number of rows supported for a segmented array on the system. Attempting to assign CONNECTIONS a larger value results in a run-time error message that states the maximum value allowed for that machine. The error is not fatal, but the CONNECTIONS assignment is not made.

Because connection indexes are zero-relative, the highest possible connection index is one less than the value of CONNECTIONS. For example, CONNECTIONS = 10 allows the use of connections numbered 0 through 9.

The CONNECTIONS value can be increased, but not decreased, by assignment statements in a program. If CONNECTIONS is decreased, an attribute error results.

The CONNECTIONS value might also increase because of library linkage. Refer to APPROVAL earlier in this section.

When a program attempts to set the CONNECTIONS attribute to an erroneous value that is less than 1, the CONNECTIONS attribute is set to 1 and the following system message is given:

LIBRARY ATTRIBUTE ERROR: CONNECTIONS MUST EXCEED ZERO

If CONNECTIONS is not specified in the connection library declaration, then CONNECTIONS defaults to 1, but can be increased later.

If the SINGLE modifier is used in the connection library declaration, then only a single connection is allowed. In this case, the CONNECTIONS attribute is treated as read-only. Any attempt to modify it results in an attribute error.