Description

TO server-name or variable
Identifies the application server by the specified server name or the server name contained in the variable. If a variable is specified:

When the CONNECT statement is executed, the specified server name or the server name contained in the variable must identify an application server described in the local directory and the activation group must be in the connectable state.

If the server-name is a local relational database and an authorization-name is specified, it must be the user of the job. If the specified authorization-name is different than the user of the job, an error occurs and the application is left in the unconnected state.

USER authorization-name or variable
Identifies the authorization name that will be used to connect to the application server.

If a variable is specified,

USING password or variable
Identifies the password that will be used to connect to the application server.

If password is specified as a literal, it must be a character string. The maximum length is 128 characters. It must be left justified. The literal form of the password is not allowed in static SQL or REXX.

If a variable is specified,

RESET
CONNECT RESET is equivalent to CONNECT TO x where x is the local server name.
CONNECT with no operand
This form of the CONNECT statement returns information about the current server and has no effect on connection states, open cursors, prepared statements, or locks. The connection information is returned in the connection information items in the SQL Diagnostics Area (or the SQLCA).