Remote SQL Pass-Through (RSPT) Facility
CONNECT TO REMOTE Statement
Establishes a connection to a DBMS or to SAS data
through a SAS server.
Requirement: |
SAS/ACCESS software |
Syntax
CONNECT TO REMOTE <AS alias> (<options>);
Optional Arguments
- AS alias
-
specifies an alias
for the server.
- SERVER=server-ID | _ _port-number
-
specifies the name
of the server. If the server is a multi-user server, server-ID is the name specified in the ID= option
in the PROC SERVER statement. If the server is a single-user server
that runs on a SAS/CONNECT server, server-ID is the
name of the SAS/CONNECT
server. In either case, server-ID is the same server name that is specified in the SERVER= option
in a LIBNAME statement.
The TCP/IP access method
enables you to specify syntax that uses two consecutive underscores
with a port number, in place of a server ID that has been defined
in the client TCP/IP SERVICES file.
Note: Do not space after the first
underscore or the second underscore.
For
port-number, specify a number that is greater
than 1024 and that is not already used in the TCP/IP SERVICES file.
- SAPW=password | “encoded-password” | _PROMPT_
-
specifies the password
for controlling user access to a multi-user server. The password must
be a valid SAS name and must be 8 characters or less in length. This
password is in the UAPW= option in the PROC SERVER statement. If the
UAPW= option is specified when the server is started, you must specify
the SAPW= option in a CONNECT TO REMOTE statement that specifies the
same server.
- password
-
must be a valid SAS
name that is 1 to 8 characters in length. The value for this option
is replaced by Xs in the log. To protect this password, you should
use the security software at your site to limit access to the SAS
program statements that create the server.
- “encoded-password”
-
is an encoded version
of a password. Using encoded passwords promotes security and enables
you to store SAS programs that do not contain clear-text passwords.
To obtain an encoded
password, specify the clear-text password as input to the PROC PWENCODE
statement. For information about PROC PWENCODE, see the PWENCODE Procedure
in the
Base SAS Procedures Guide.
Here is an example
of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
The clear-text password
srvmach
is specified in the PROC PWENCODE statement.
The output is generated in the form
{key}encoded-password.
sas001 is the key, which
is used to decode the encoded password to its clear-text form when
the password is needed.
Note: The encoded password is case-sensitive.
Use the entire generated output string, including the key.
Use the output from
the PROC PWENCODE statement as the value for
encoded-password in the appropriate statement.
- _PROMPT_
-
specifies that SAS
prompt the user for a valid password. A dialog box appears that prompts
the user to enter a valid password. This enables you to specify the
value at program execution instead of coding it into the program.
Using _PROMPT_ is a way to enforce security.
- USER=user-name |
_PROMPT_
-
specifies the user
ID of the accessing client on the server. The operating environment
in which the client runs can also affect user-naming conventions.
For details about user-naming conventions imposed by the operating
environment, see Communications Access Methods for SAS/CONNECT and SAS/SHARE.
Here are the valid
values for the USER= option:
- user-name
-
For details about specifying
a valid user name, see Details .
- _PROMPT_
-
specifies that SAS
prompt the user for a valid user name. Using _PROMPT_ is a way to
enforce security.
Aliases:USERNAME
USERID
UID
- PASSWORD=password | “encoded-password” | _PROMPT_
-
specifies the password
of the accessing client on the server. The operating environment in
which the client runs can also affect password-naming conventions.
For details about password-naming conventions imposed by the operating
environment, see Communications Access Methods for SAS/CONNECT and SAS/SHARE.
Here are the valid
values for the PASSWORD= option:
- password
-
must be a valid SAS
name that is 1 to 8 characters in length. The value for this option
is replaced by Xs in the log. To protect this password, you should
use the security software at your site to limit access to the SAS
program statements that create the server.
- “encoded-password”
-
is an encoded version
of a password. Using encoded passwords promotes security and enables
you to store SAS programs that do not contain clear-text passwords.
To obtain an encoded
password, specify the clear-text password as input to the PROC PWENCODE
statement.
Here is an example
of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
The
clear-text password
srvmach
is specified
in the PROC PWENCODE statement. The output is generated in the form
{key}encoded-password.
sas001 is the key, which is used to decode
the encoded password to its clear-text form when the password is needed.
For information about PROC PWENCODE, see the PWENCODE Procedure
in the
Base SAS Procedures Guide.
Note: The encoded password is case-sensitive.
Use the entire generated output string, including the key.
Use the output from
the PROC PWENCODE statement as the value for
encoded-password in the appropriate statement.
- _PROMPT_
-
specifies that SAS
prompt the user for a valid password. A dialog box appears that prompts
the user to enter a valid password. This enables you to specify the
value at program execution instead of coding it into the program.
Using _PROMPT_ is a way to enforce security.
Aliases:PASSWD
PASS
PWD
PW
- DBMS=dbms-name
-
specifies the name
of the server DBMS that you want to connect to. This is the same name
that you would specify in a CONNECT TO statement if you were connecting
directly to the DBMS. Use this option if you want to connect to a
server DBMS instead of the SAS SQL server.
- PT2DBPW=password | "encoded-password"
-
specifies the password
for controlling pass-through access to server DBMS databases that
are specified in the PT2DBPW= option in the PROC SERVER statement.
If PT2DBPW= is specified when the server is started, you must specify
the PT2DBPW= option in a CONNECT TO REMOTE statement that specifies
the same server and also specifies the DBMS= option.
- password
-
must be a valid SAS
name that is 1 to 8 characters in length. The value for this option
is replaced by Xs in the log. To protect this password, you should
use the security software at your site to limit access to the SAS
program statements that create the server.
- “encoded-password”
-
is an encoded version
of a password. Using encoded passwords promotes security and enables
you to store SAS programs that do not contain clear-text passwords.
To obtain an encoded
password, specify the clear-text password as input to the PROC PWENCODE
statement. For details, see the
Base SAS Procedures Guide.
Here is an example
of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
The clear-text password
srvmach
is specified in the PROC PWENCODE statement.
The output is generated in the form
{key}encoded-password.
sas001 is the key, which
is used to decode the encoded password to its clear-text form when
the password is needed.
Note: The encoded password is case-sensitive.
Use the entire generated output string, including the key.
Use the output from
the PROC PWENCODE statement as the value for
encoded-password in the appropriate statement.
- DBMSARG=(dbms-argument-1=value ...<dbms-argument-n=value>)
-
specifies the arguments
that are required by the server DBMS to establish the connection.
These are the same arguments that you would specify in a CONNECT TO
statement if you were connecting directly to the DBMS.
Copyright © SAS Institute Inc. All rights reserved.