DATA Step, Macro, Functions and more

Multiple Threading

Reply
Super Contributor
Posts: 647

Multiple Threading

Hi,
I have 30 datasets that are to be sorted and then merged later.I heard there somethng about multi threading where we can sort all 30 data sets at once instead of sorting one after the other.Please help me on this.
Super Contributor
Super Contributor
Posts: 3,174

Re: Multiple Threading

How about the SAS DOC and the SAS Support website to start?

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic/post:
sort multiple threads site:sas.com
Valued Guide
Posts: 2,175

Re: Multiple Threading

SASPhile
what Scott (SBB) is hoping you will find is referred to in many papers as mpConnect for multi-processing connect. Including this topic the "scalability" focus area, is well worth visiting at http://support.sas.com/rnd/scalability/index.html
.
peterC
Super Contributor
Posts: 647

Re: Multiple Threading

I tried to emulate the code shown in sas support but i got these following errors:

ERROR:A communication subsystem partner link setup request failure has occurred.
ERROR: Cannot locate TCP host 'TASK1'.
ERROR: Remote signon to TASK1 cancelled.

The code I used is:


options autosignon=yes sascmd="sas";
signon task1 userid=sasprod;

/* create TASK1 SAS session to sort the SALES data */
rsubmit task1 wait=no sysrputsync=yes;
proc sort data=sashelp.shoes out=shoes1;
by product;
run;
/* get TASK1's WORK library path in parent session */
%sysrput pathtask1=%sysfunc(pathname(work));
endrsubmit;
signon task2 userid=sasprod;

/* create TASK2 SAS session to sort the GOALS data */
rsubmit task2 wait=no sysrputsync=yes;
proc sort data=sashelp.steel out=steel1;
by steel;
run;
/* get TASK2's WORK library path in parent session */
%sysrput pathtask2=%sysfunc(pathname(work));
endrsubmit;
Valued Guide
Posts: 2,175

Re: Multiple Threading

SASPhile
"getting started with SAS/Connect" needs a little more than the example that you have found.
"signon" works as long as there is somewhere "listening" - so have you a sas server with a service listening for your "signon"?
I suspect not.
You will find many benefits for design and performance of your systems once the SAS/Connect services can be started, but it requires some unusual learning, and probably help from a system administrator for whom setting up system services, like a sas connect listener, is "ordinary".

Good luck
peterC
Super User
Posts: 3,105

Re: Multiple Threading

As well as following Peter's advice I would suggest contacting your SAS Server administrator and/or knowledgeable SAS users at your site. Usually they know what configuration is required to signon. Usually it involves specifying the IP address of the SAS server and what TCP/IP port to communicate on.

BTW the example you have is right on the money. You may also find the WAITFOR statement useful.
Trusted Advisor
Posts: 2,113

Re: Multiple Threading

The multi-threading is within one SORT. To use it on 30 datasets requires first combining the datasets. Probably better to do 30 sorts.
Super User
Posts: 3,105

Re: Multiple Threading

The only way of doing concurrent sorting (or any process for that matter) that I am aware of is by doing it in separate SAS sessions. If you have SAS/CONNECT then you can create several asynchronous SAS sessions each doing their own processing in parallel/concurrently then get the parent SAS session to wait until all your child sessions have finished processing.

This is probably only worth doing on a server with the I/O capacity to cope. On a desktop machine the first sort would tend to dominate the disk drive and all of the other concurrent sorts would be very slow.
Ask a Question
Discussion stats
  • 7 replies
  • 195 views
  • 0 likes
  • 5 in conversation