DBSLICE= applies only
to a table reference. You can use it to code your own WHERE clauses
to partition table data across threads, and it is useful when you
are familiar with your table data. For example, if your DBMS table
has a CHAR(1) column Gender and your clients are approximately half
female, Gender equally partitions the table into two parts. Here is
an example.
proc print data=lib.dbtable (dbslice=("gender='f'" "gender='m'"));
where dbcol>1000;
run;
SAS creates two threads
and about half of the data is delivered in parallel on each connection.
When applying DBSLICEPARM=ALL
instead of DBSLICE=, SAS attempts to "autopartition" the table for
you. With the default DBSLICEPARM=THREADED_APPS setting, SAS automatically
attempts threaded Reads only for SAS threaded applications, which
are SAS procedures that thread input, output, and numeric operations.
DBSLICEPARM=ALL extends threaded Reads to more SAS procedures, specifically
steps that only read tables. Or, DBSLICEPARM=NONE turns it off entirely.
You can specify it as a data set option, a LIBNAME option, or a global
SAS option.
The first argument to
DBSLICEPARM= is required and extends or restricts threaded Reads.
The second optional argument is not commonly used and limits the number
of DBMS connections. These examples demonstrate the different uses
of DBSLICEPARM=.
-
UNIX or Windows SAS invocation
option that turns on threaded Reads for all read-only libref:
-
Global SAS option that turns off
threaded Reads:
-
LIBNAME option that restricts threaded
Reads to just SAS threaded applications:
libname lib oracle user=scott password=tiger dbsliceparm=THREADED_APPS;
-
Table option that turns on threaded
Reads, with a maximum of three connections in this example:
proc print data=lib.dbtable(dbsliceparm=(ALL,3));
where dbcol>1000;
run;
DBSLICE= and DBSLICEPARM=
apply only to DBMS table reads. THREADS= and CPUCOUNT= are additional
SAS system options that apply to threaded applications. For more information
about these options, see
SAS System Options: Reference.