THREADNUM= Table Option

Specifies the number of threads to be used for WHERE clause evaluations.

Valid in: SPD Server
Default: THREADNUM= is set equal to the value of the MAXWHTHREADS server parameter.
Interactions: Corresponding macro variable is SPDSTCNT.
THREADNUM= is affected by the MAXWHTHREADS= server parameter.

Syntax

THREADNUM=n

Required Argument

n

the number of threads.

Details

THREADNUM= enables you to specify the thread count that the server should use when performing a parallel WHERE clause evaluation.
Use this option to explore scalability for WHERE clause and GROUP_BY evaluations in non-production jobs. If you use this option for production jobs, you are likely to lower the level of parallelism that is applied to those clause evaluations.
THREADNUM= works in conjunction with MAXWHTHREADS, a configurable system parameter. MAXWHTHREADS imposes an upper limit on the consumption of system resources. The default value of MAXWHTHREADS is dependent on your operating system. Your server administrator can change the default value for MAXWHTHREADS.
If you do not use THREADNUM=, the software provides a default thread number, up to the value of MAXWHTHREADS as required. If you use THREADNUM=, the value that you specify is also constrained by the MAXWHTHREADS value.
The THREADNUM= value applies to parallel table scans (EVAL2 strategy), parallel indexed evaluations (EVAL1 strategy), parallel BY-clause processing, and parallel GROUP_BY evaluations. See Optimizing WHERE Clauses.

Example

The server administrator set MAXWHTHREADS=128 in the server parameter file. Explore the effects of parallelism on a given query by using the following SAS macro:
%macro dotest(maxthr);
%do nthr=1 %to &maxthr
   data _null_;
     set SPDSCEN.PRECS(threadnum=&nthr);
     WHERE
       occup='022'
       and state in('37','03','06','36');
   run;
%mend dotest;

See Also

SPD Server macro variables:
Last updated: February 8, 2017