Configuring SPD Server on a Corporate Network

Example Scenario

The corporation in this example maintains a network of computers. The corporate network contains a mix of computers and processing power: machines with multiple processors and large amounts of available disk space, smaller machines that are used for servers, and desktop machines for client users. The dedicated servers have the following names:
worldcpu
a data store for the company's worldwide operations
asiacpu
a data store for the company's Asia department, which uses the data to generate reports, analysis, and so on
namecpu
the machine that runs the name server
Because data for worldwide operations is stored in an SPD Server table on worldcpu, the Asia department must periodically access that server. The Asia users want to extract worldcpu data to create SPD Server tables that will reside on their own departmental server, asiacpu. The Asia users can then access tables that contain only Asia data, and transfer that information to their desktops for further analysis.
The SPD Server system administrator runs the name server on the namecpu machine. Consequently, namecpu must be accessible by every machine in the network that wants to locate an SPD Server table. The administrator must also run a data server on the worldcpu and asiacpu machines. The following section describes how to configure the servers in order to distribute the processing load.

Run the Name Server on the namecpu Machine

Invoke the name server by using the -listenport option. Specify a valid TCP/IP port number. Use the same port number when you invoke SPD Server on the worldcpu and asiacpu servers.

Configure SPD Server on the worldcpu server

The libname.parm file that resides on the worldcpu server contains the following line:
LIBNAME=world pathname=/spds; 
This code instructs SPD Server to register the combination (world, worldcpu, /spds) with the name server. Thereafter, when a SAS LIBNAME statement contains the domain name world in combination with the appropriate name server, it will locate SPD Server tables in the directory /spds on the worldcpu server. The following SAS LIBNAME statement invokes the SPD Server engine and makes this association:
LIBNAME worldlib sasspds 'world' 
  server=namecpu.spdsname; 
When your network uses an SPD Server name server, the users do not have to remember which machine houses a particular domain. Users need to remember only that the SAS domain named world contains the tables that they need. Even if the machine that stores the domain changes without the users' knowledge, the users' SAS programs continue to run as before.
Specify namecpu as the value for the -nameserver option and invoke SPD Server. The value for the name server port must match the port number that you used to start the name server on that machine.

Set Up asiacpu, the Asia Departmental Server

The libname.parm file that resides on asiacpu contains the following line of code:
LIBNAME=asia pathname=/spds; 
This code instructs the SPD Server that is running on asiacpu to register the combination (asia, asiacpu, /spds) with the name server. When a SAS LIBNAME statement contains the domain name asia in combination with the appropriate name server, it will locate SPD Server tables in the directory /spds on machine asiacpu. The following SAS LIBNAME statement invokes the SPD Server engine and makes this association:
LIBNAME asialib sasspds 'asia' 
  server=namecpu.spdsname; 
The value that follows the LIBNAME server specification is the same in all these LIBNAME statements because both SPD Servers use a common name service. Asia departmental users do not need to know the name of the machine that provides storage for their domain.

Which SAS Program Statement Runs Where?

Assume that a user in the Asia department needs to create an SPD Server table on the departmental server asiacpu. This task requires data to be extracted from an SPD Server table named alldata. The user knows that the alldata table resides in the domain world. The user submits the following SAS code on a desktop SPD Server client:
 LIBNAME worldlib sasspds 'world' 
  server=namecpu.spdsname;
 LIBNAME asialib sasspds 'asia' 
  server=namecpu.spdsname;

 data asialib.mydata;
 set worldlib.alldata;
 where region='Asia';
 if country='Japan' then
     subreg=1;
 run; 
This code extracts records from an SPD Server table named alldata that resides in the domain world. The world domain is stored on machine worldcpu in the directory /spds. Because the alldata table resides on worldcpu, and SPD Server processes certain SAS WHERE clauses, the search for the value Asia is performed on worldcpu.
The SAS program runs on the Asia user's desktop machine. The desktop machine scans each row in the alldata table, looking for the string Japan. If the string is found, the desktop client forwards the row to the machine on which the output table resides, which is asiacpu in this example.
Disk space for the output table mydata is allocated in the /spds directory on asiacpu. The processing work (transferring data received from the user's desktop machine to the SPD Server table) is also performed by asiacpu.
The processing that was required to create the output SPD Server table was distributed across three machines. However, the user's desktop machine requires no permanent disk space, because SAS WHERE clauses execute on the machine that stores the source table. Only the selected rows that match the submitted WHERE clause are sent over the network to the desktop client. This strategy significantly reduces both network traffic and the time that is needed to complete a SAS program.