You use the SET SERVER
command to specify the current server and override the server that
was specified in a previous SET SERVER command. This specified server
also overrides the default server that was specified in a SERVERID=
option in the PROC OPERATE statement. The effect of a SET SERVER command
is limited to the current execution of PROC OPERATE. Here is the syntax
for this command:
SET SERVER;
SET SERVER server-ID <(SAPW=password)>;
SET SERVER server-ID </ SAPW=password>;
SAPW=
password | “
encoded-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.
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.
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.
If no server is specified,
the SET SERVER command resets the current server to the default server
that is specified in the SERVERID= option in the PROC OPERATE statement.
However, if the SERVERID= option was not specified in the PROC OPERATE
statement, SET SERVER retains the current server value.
In the following example,
the SET SERVER command establishes the current server and displays
information about that server without your having to specify a server
ID.
proc operate;
set server share1;
display server;
In the following example,
PROC OPERATE displays information about the server libraries that
are identified by LIB1 and LIB2 in the DISPLAY LIBRARY command. These
libraries are defined to the current server MYSHR. Next, the current
server is reset to SHARE, and information is displayed about the library
LIBALPHA, which is defined to the server SHARE.
proc operate serverid=share;
set server myshr;
display library lib1 lib2;
set server;
display library libalpha;
If you do not identify
a server before you issue a command that acts on the current server,
PROC OPERATE issues the following message:
ERROR: PROC OPERATE is not currently set to any
server, so this command will be ignored. Use
the 'SET SERVER serverid;' command to establish
communication with a server.