Migrating Tables between SAS and SPD Server

Many organizations use SPD Server because they need more horsepower to handle large SAS tables. As a result, you will frequently want to migrate data in both directions between SAS and SPD Server. SPD Server provides simple methods to easily migrate data between SAS and SPD Server.

SAS and SPD Server Table Migration Examples

Create a SAS Table from an SPD Server Table

To create a SAS table from an SPD Server table, issue a LIBNAME statement, but do not specify the engine SASSPDS. Your program creates a Base SAS table. (Later, if you decide to use SPD Server capabilities, you can convert the Base SAS table to the SPD Server format. Conversion is easy. Interchange table formats using the COPY procedure. See Example 2.)
/* Create local racquets data set. */
   LIBNAME local '/u/sasdemo/local';

   data local.racquets;
      input racquet_name $20. @22 weight_oz @28 balance $2.
         @32 flex @36 gripsize
         @42 string_type $3. @47 retail_price @55 inventory_onhand;
      datalines;
   Filbert VolleyMaster 10.5  HL   5  4.5   syn  129.95   5
   Solo Queensize       10.9  HH   6  5.0   syn  130.00   3
   Perkinson AllCourt   11.0   N   5  4.25  syn  159.99  12
   Wilco Specialist      8.9  HL   3  5.0   nat  287.50   1
   ;

Convert from SAS to SPD Server Format

SITEUSR1 creates libref SPORT, associates SPORT with the SPD Server engine SASSPDS, and points to the CONVERSION_AREA domain on an SPD Server host server named HUSKY. User SITEUSR1 uses a default named service SPDSNAME to locate the port number of the Name Server and requests a prompt for the password.
The PROC COPY statement inputs the SAS table LOCAL.RACQUETS and outputs the SPD Server table SPORT.RACQUETS to the CONVERSION_AREA domain. After the PROC COPY statement executes, the SAS table becomes two SPD Server table component files. (See Figure 4.6.)
  /* Copy existing SAS table to the SPD Server format. */
     LIBNAME sport sasspds 'conversion_area' 
     server=husky.spdsname
     user='siteusr1' 
     prompt=yes;

     proc copy in=local out=sport;
     select racquets;
     run;

PROC COPY Converts a SAS Table to an SPD Server Table
Converting SAS tables to SPD Server tables