To perform a threaded Read, SAS first creates threads within the SAS session. Threads are standard operating system tasks that SAS controls. SAS then establishes a DBMS connection on each thread, causes the DBMS to partition the result set, and reads one partition per thread. To cause the partitioning, SAS appends a WHERE clause to the SQL so that a single SQL statement becomes multiple SQL statements, one for each thread. Here is an example.
proc reg SIMPLE
data=dblib.salesdata (keep=salesnumber maxsales);
ar _ALL_;
run;
Previous versions of SAS opened a single connection and issued:
SELECT salesnumber,maxsales FROM SALESDATA;
Assuming that SalesData has an EmployeeNum integer column, SAS 9.1 might open two connections by issuing these two statements:
SELECT salesnumber,maxsales FROM salesdata WHERE (EMPLOYEENUM mod 2)=0;
SELECT salesnumber,maxsales FROM SALESDATA WHERE (EMPLOYEENUM mod 2)=1;
For more information about MOD, see Autopartitioning Techniques in SAS/ACCESS.