Chapter Contents

Previous

Next
SAS/CONNECT User's Guide

Example 2. Compute Services and Data Transfer Services Combined: Sorting and Merging Data


Purpose

In cases where the same remote data set needs to be manipulated by multiple local hosts, data transfer services can be used to distribute the subset of data that is needed by each local host. Each local host receives only the data it needs and uses its compute services to process that data in the local GUI. With this method, local hosts do not have to continually access the data set on the remote machine.


Program

The following SCL program fragment distributes a reservations data set from a remote host at a central office to local hosts at a number of franchise offices. The program enables distribution of reservations to a franchise office by using a WHERE statement to select the desired reservations.

   INIT:
   submit continue;
   signon atlanta;

[1] rsubmit;
      libname mres "d:\counter";
      libname backup "d:\counter\backup";

       proc upload data=mres.reserv
          out=combine status=no;
          where origin="Atlanta";
       run;

[2]     proc sort data=combine;
          by resnum;
       run;

[3]     proc copy in=mres out=backup;
          select reserv;
       run;

[4]     data mres.reserv;
          update mres.reserv combine;
          by resnum;
       run;
   endrsubmit;

   signoff;
   endsubmit;
[1] Upload all reservations for a particular location.
[2] Sort uploaded data sets for merging.
[3] Backup existing data set.
[4] Merge new and existing data sets.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.