Controls the scope of DBMS threaded Reads and the number of threads.
| Valid in: | SAS/ACCESS LIBNAME statement (also available as a SAS configuration option, SAS invocation option, global SAS option, or data set option) |
|---|---|
| Category: | Data Set Control |
| Default: | NONE [DB2 under UNIX and PC Hosts, Google BigQuery, Greenplum, Microsoft SQL Server, Vertica] |
| THREADED_APPS, none [HAWQ] | |
| THREADED_APPS,2 [DB2 under z/OS, Oracle] | |
| THREADED_APPS,2 or THREADED_APPS,3 [Informix, ODBC, SAP ASE, SAP HANA, SAP IQ] | |
| none (no default value) [Teradata] | |
| Restriction: | Teradata: Starting in SAS 9.4M9, do not specify the value ALL (all platforms). This option is not supported for Teradata on z/OS. Instead, set FASTLOAD=YES. |
| Interaction: | Google BigQuery: To use this option, you must also set READ_MODE=STORAGE (or MODE=PERFORMANCE, which sets READ_MODE=STORAGE). Otherwise, this option is ignored. |
| Data source: | DB2 under UNIX and PC Hosts, DB2 under z/OS, Google BigQuery, Greenplum, HAWQ, Informix, Microsoft SQL Server, ODBC, Oracle, SAP ASE, SAP HANA, SAP IQ, Teradata, Vertica |
| Note: | Support for Google BigQuery was added in SAS 9.4M9. Support for Google BigQuery on SAS 9.4M8 was added in December 2025. |
| See: | DBSLICE= data set option, DBSLICEPARM= data set option, DBSLICEPARM= system option, SLEEP= LIBNAME option, SLEEP= data set option, TENACITY= LIBNAME option, TENACITY= data set option |
Table of Contents
disables DBMS threaded Read. SAS reads tables on a single DBMS connection, as it did with SAS 8 and earlier.
makes fully threaded SAS procedures (threaded applications) eligible for threaded Reads.
makes all read-only librefs eligible for threaded Reads. This includes SAS threaded applications, as well as the SAS DATA step and numerous SAS procedures.
| Restriction | Teradata: Starting in SAS 9.4M9, do not specify the value ALL. |
|---|
a positive integer value that specifies the maximum number of connections per table read. The second parameter of the option determines the number of threads to read the table in parallel. The number of partitions on the table determine the number of connections made to the Oracle server for retrieving rows from the table. A partition or portion of the data is read on each connection. The combined rows across all partitions are the same regardless of the number of connections. That is, changes to the number of connections do not change the result set. Increasing the number of connections instead redistributes the same result set across more connections.
If the database table is not partitioned, SAS creates max-threads number of connections with WHERE MOD()… predicates and the same number of threads.
There are diminishing returns when increasing the number of connections. With each additional connection, more burden is placed on the DBMS, and a smaller percentage of time saved on the SAS step. See the DBMS-specific reference section for details about partitioned reads before using this parameter.
You can use DBSLICEPARM= in numerous locations. The usual rules of option precedence apply: A table (data set) option has the highest precedence, then a LIBNAME option, and then the system option. A SAS configuration file option has the lowest precedence because DBSLICEPARM= in any of the other locations overrides that configuration value.
DBSLICEPARM=ALL and DBSLICEPARM=THREADED_APPS make SAS programs eligible for threaded Reads. To see whether threaded Reads are actually generated, turn on SAS tracing and run a program, as shown in this example.
options sastrace=",,t" sastraceloc=saslog nostsuffix;
proc print data=lib.dbtable(dbsliceparm=(ALL));
where dbcol>1000;
run;
If you want to directly control the threading behavior, use the DBSLICE= data set option.
DB2 under UNIX and PC Hosts, Informix, Microsoft SQL Server, ODBC, SAP ASE, SAP IQ: The default thread number depends on whether an application passes in the number of threads (CPUCOUNT=) and whether the data type of the column that was selected for data partitioning is binary.
DB2 under z/OS: For more information about autopartitioning with DB2 under z/OS, see READBUFF= Restriction.
Greenplum, HAWQ: There is no default value for the maximum number of connections per table read. This value depends on the number of partitions in a table and on arguments that are used with the MOD function in a WHERE clause. For more information, see Autopartitioning Techniques in SAS/ACCESS.
Here is how to use DBSLICEPARM= in a SAS configuration file entry in Windows to turn off threaded Reads for all SAS users.
-dbsliceparm NONE
Here is how you can use DBSLICEPARM= as a z/OS invocation option to turn on threaded Reads for read-only references to DBMS tables throughout a SAS job.
sas o(dbsliceparm=ALL)
In this example, you can use DBSLICEPARM= as a SAS global option to increase maximum threads to three for SAS threaded applications. This OPTIONS statement is typically one of the first statements in your SAS code.
options dbsliceparm=(threaded_apps,3);
You can use DBSLICEPARM= as a LIBNAME option to turn on threaded Reads for read-only table references that use this particular libref, as shown in this example.
libname dblib oracle user=myusr1 password=mypwd1 dbsliceparm=ALL;
Here is how to use DBSLICEPARM= as a table-level option to turn on threaded Reads for this particular table, requesting up to four connections.
proc reg SIMPLE;
data=dblib.customers (dbsliceparm=(all,4));
var age weight;
where years_active>1;
run;