Previous Page | Next Page

LIBNAME Statement and Pass-Through Facility for PC Files on Microsoft Windows

DISCONNECT Statement



Terminates the connection to the data source.
Valid in: PROC SQL steps

Syntax
Arguments
Details
Example

Syntax

DISCONNECT FROM data-source-name | alias


Arguments

data-source-name

specifies the data source from which you want to disconnect. You can use an alias in the DISCONNECT statement. The DISCONNECT statement's data source name or alias must match the name or alias that you specified in the CONNECT statement.

alias

specifies an alias that was defined in the CONNECT statement.


Details

The DISCONNECT statement ends the connection with the data source. If the DISCONNECT statement is omitted, an implicit DISCONNECT is performed when PROC SQL terminates. The SQL procedure continues to execute until you submit a QUIT statement, another SAS procedure, or a DATA step.

Any return code or message that is generated by the data source is available in the macro variables SQLXRC and SQLXMSG after the statement executes.

See: Return Codes


Example

Use the QUIT statement to quit the SQL procedure after the connection and SQL processing uses the DISCONNECT statement to disconnect the connection from the database:

DISCONNECT FROM db;
QUIT;

Previous Page | Next Page | Top of Page