listenport option
defines the port that must be used by clients (such as SAS) in LIBNAME
and SQL CONNECT statements. listenport option
can also define the port that an ODBC data source requires to communicate
with the SPD Server Name Server. The operport
option defines a second port that is used for various command communications
from SPD Server utilities. Either of these ports can be specified
using well-known port definitions in the operating system's services
file, instead of specifying them on the command-line. In UNIX systems,
this is typically the /etc/services file.
In the services file, the spdsname specification
corresponds to listenport,
and the spdsoper setting
corresponds to the operport
setting. Both of these ports should be surfaced through the firewall.
listenport
command-line option. The SPDSSERV listenport command
performs LIBNAME authentication of the SPD Server user and password,
and validates access to the SPD Server domain. The second port in
the second category is the port that is used for various communications
from SPD Server utilities, and is defined by the SPDSSERV -operport
command-line option.
listenport and operport specifications
are registered in the SPD Server Name Server by the SPDSSERV process
when it starts. Both specifications are returned to the SPD Server
client from the SPD Server Name Server when it maps the LIBNAME domain
to an SPDSSERV. If you do not specify a listenport or operport in
the SPDSSERV command-line, any port that is available is used. Both
of these ports should be specified in the SPDSSERV command-line and
surfaced through the firewall.
listenport and operport ,
must be surfaced for access beyond the firewall. This is also true
for any other ports that are identified in SPDSNAME and SPDSOPER services.
listenport and operport ,
as well as any other ports that are identified in SPDSSERV_SAS and
SPDSSERV_OPER services.
-libnamefile, specifies the LIBNAME
start-up file. For more information about LIBNAME domains and LIBNAME
start-up files, see Domains and Data Spaces in SAS Scalable Performance Data Server: Administrator's GuideLIBNAME sample sasspds 'ldname' server=spdshost.spdsname user='johndoe' prompt=yes ;
PROC DATASETS lib=spds ; modify a(asyncindex=yes) ; index create x ; index create y ; index create comp=(x y) ; quit;
%LET spdsiasy=YES ; PROC DATASETS lib=spds ; modify a ; index create x ; index create y ; modify a ; index create comp=(x y) comp2=(y x) ; quit ;
LIBNAME foo sasspds ... ; PROC SPDO lib=foo ; SPDSMAC ;
number_of_discrete_values_in_the_index * (22.5 + (length_of_columns_composing_the_index))
number_of_discrete_value_in_the_index * (6 + (length_of_columns_composing_the_index))
8192 + (number_of_discrete_values_in_more_than_one_obs * (24 + (avg_number_of_segments_per_value * (16 + (seg_size / 8)))))
.hyb_size = 1024 * (22.5 + 8) = 31323 bytes .idx_size = 8192 + (10000 * (24 + (4 * (16 + (8192/8))))) = 4343808 bytes
.hyb_size = 100000 * (6 + 8) = 1400000 bytes .idx_size = 8192 + (0 * (...)) = 8192 bytes
SpaceBytes ~ #rows * SortLength(x)where #rows = Number of rows in the table if creating; number of rows in the append if appending.
if KeyLength(x) >= 20 bytes SortLength(x) = (4 + KeyLength(x)) if KeyLength(x) < 20 bytes SortLength(x) = 4 + (4 * floor((KeyLength(x) + 3) / 4))
DATA foo.test ; length xc $15 ; do x=1 to 1000 ; xc = left(x) ; output ; end ; run ; PROC DATASETS lib=foo ; modify test ; index create x xc xxc=(x xc) ; quit ;
SpaceBytes = 1000 * (4 + (4 * floor((8 + 3) / 4)))
= 1000 * (4 + (4 * floor(11 / 4)))
= 1000 * (4 + 4 * 2)
= 12,000
SpaceBytes = 1000 * (4 + (4 * floor(15 + 3) / 4)))
= 1000 * (4 + (4 * floor(18 / 4)))
= 1000 * (4 + 4 * 4)
= 20,000
SpaceBytes = 1000 * (4 + 23)
= 1000 * 27
= 27,000SpaceBytes = #rows * (SortKeyLength + 4 + RowLength)
SpaceBytes = #rows * (SortKeyLength + 8)
|
SAS code, by line
|
Remarks
|
|---|---|
LIBNAME dmowner sasspds "tomdom" host="samson" serv="5555" user="tom" passwd="tompw" ; |
|
|
PROC SPDO lib=dmowner
;
|
PROC SPDO opens the
command set that allows the user tom to change
ACLs in the tomdom domain using the libref dmowner.
|
|
set acluser tom ;
|
SET ACLUSER command
allows ACLs under user ID tom to be modified.
|
|
add acl/LIBNAME ;
|
Command to add the ACL
for a LIBNAME domain.
LIBNAME is the syntax
used to indicate the LIBNAME domain assigned, which is tomdom to
the libref that PROC SPDO is started with, which is dmowner.
|
|
modify acl/LIBNAME fred=(Y,Y,,)
;
|
Modifies the ACL in
the LIBNAME domain ACL to give user ID fred Read
and Write access to the tomdom domain.
|
|
quit ;
|
|
Command from command
prompt >
|
Remark
|
|---|---|
|
LIBNAME test saspds
'temp'
server=servname.7880
prompt=yes ;
|
Issue LIBNAME statement
for test domain, specify server and port number, ask system for a
password prompt.
|
|
user="username"
aclspecial=YES ;
|
aclspecial=YES now gives
"username" access to special ACL commands, such as setting
a new user ID.
|
|
PROC SPDO lib=test ;
|
Connects to the temp
LIBNAME domain using the libref test.
|
|
set acluser user1 ;
|
Sets the SPD Server
user scope to user1.
|
|
list acl _all_ ;
|
Lists all ACLs owned
by user1.
|
|
Resulting output from
list acl _all_; command
|
Remarks
|
|---|---|
|
The SAS System 10:58
Tuesday, November 17, 2003
|
System message
|
|
ACL Info for A.DATA
|
This ACL affects table
A if table A exists and user1 is the owner or has ACL control of table
A.
|
|
Owner = USER1
|
USER1 created and owns
the A.DATA ACL.
|
|
Group = TECH
|
This ACL was created
while user1was connected with an ACL group of TECH. All group permissions
affect the permissions of the members of the TECH ACL group.
|
|
Default Access (R,W,A,C)
= (Y,N,N,N)
|
R=Read; W=Write; A=Alter
(rename, delete, or replace tables) C=Control (define and update ACLs
for a table)
Y=Yes; N=No;
Universal privileges
are limited to read on table A.DATA.
|
|
Group Access (R,W,A,C)
= (N,N,N,N)
|
Users in the ACL group
TECH have no privileges on table A.DATA.
|
|
The SAS System 10:58
Tuesday, November 17, 2003
|
|
|
ACL Info for NTE*.DATA
|
NTE*.DATA refers to
a set of tables, which begin with NTE. ACLs of this kind are created
using the generic option. If you create a specific ACL for a table
that starts with NTE, the specific ACL overrides the generic ACL.
|
|
Owner = user1
|
|
|
Group = TECH
|
|
|
Default Access (R,W,A,C)
= (N,N,N,N)
|
|
|
Group Access (R,W,A,C)
= (Y,Y,N,N)
|
Users from the ACL group
TECH have Read and Write access to tables with names that start with
NTE.
|
|
Code
|
Remarks
|
|---|---|
/* Issue a LIBNAME statement which */
/* creates a LIBREF called "test" */
LIBNAME test '/path/for/your/data' ;
/* Query using base LIBREF of test */
PROC SQL ;
select sum(table1+table2)
as pass,
carrier from test.carriers
where carrier in('AA','JI')
and bstate='TX'
group by carrier ;
quit ;
|
This is an example of
SQL code that works with SAS. The code contains a two-level SAS filename
reference, which is typical for PROC SQL, but it does not work if
we attempt to use it inside a pass-through CONNECT statement.
Each of the following
examples shows variations of this code, modified to access SPD Server
information. We also discuss the pros and cons of each method.
|
|
Code
|
Remarks:
|
|---|---|
/* Issue a SPD Server (mkt) library */
/* LIBNAME statement */
LIBNAME mkt sasspds 'mkt'
server=servername.4228
user='anonymous' ;
PROC CONTENTS data=mkt.carriers ;
run ;
/* query spds LIBREF (mkt) */
/* (two-level SAS filename) */
PROC SQL;
select sum(table1+table2)
as pass, carrier
from mkt.carriers
where carrier in
('AA','JI')
and bstate='TX'
group by carrier ;
quit ;
|
This example shows you
how to make a query against SPD Server tables, using your original
SQL code, without using the SQL pass-through facility.
|
|
Code
|
|---|
//* Query spds LIBREF (mkt) (pass-through one-level LIBREF )*/
PROC SQL;
connect to sasspds
(dbq='mkt'
serv='8770'
user='anonymous'
host='localhost') ;
select *
from connection
to sasspds
(select sum(table1+table2)
as pass,
carrier
from carriers
where carrier
in('AA','JI')
and bstate='TX'
group by carrier) ;
quit ;
|
|
Code
|
|---|
PROC SQL ;
connect to sasspds
(dbq='mkt'
serv='8770'
user='anonymous'
host='localhost');
/* Issue passthru LIBREF (mkt) for use */
/* in two-level queries */
execute(LIBREF mkt)
by sasspds;
/* Query the SPD Server LIBREF (mkt) */
/* that is a pass-through LIBREF */
select *
from connection
to sasspds
(select sum(table1+table2)
as pass,
carrier from mkt.carriers
where carrier in('AA','JI')
and bstate='TX'
group by carrier) ;
quit;
|
PROC DATASETS lib=foo ; modify customer( asyncindex=yes index=(state) ; index create state ; index create phoneno ; index create custno ; index create totsales ; quit ;
execute(begin async operation) by sasspds ; execute(create index state on customer(state)) by sasspds ; execute(create index totals on billing(totals)) by sasspds ; execute(create index orderno on orders(orderno)) by sasspds ; execute(end async operation) by sasspds ;
spdssr_<pid>_<unique_thread_id>.0.0.0.spds9
pid is
the identifier for the SPDSBASE user proxy that is performing the
parallel sort operation.
spdspgb_<pid>_<unique_thread_id>.0.0.0.spds9
pid is
the identifier for the SPDSBASE user proxy that is performing the
parallel GROUP BY operation.
spdspllj_<pid>_<unique_thread_id>.0.0.0.spds9
pid is
the identifier for the SPDSBASE user proxy that is performing the
parallel join operation.
spds_<pid>_<unique_id>.0.0.0.spds9
pid is
the identifier for the SPDSBASE SQL proxy that created the temporary
workspace file.
spdslog_<pid>_<unique_id>.0.0.0.spds9
pid is
the identifier for the SPDSBASE user proxy that created the temporary
workspace file.
ps -ef in UNIX,
or by viewing the command line information in Windows task manager.