Chapter Contents

Previous

Next
SAS/CONNECT User's Guide

Example 5. RLS: Updating a Remote Data Set by Applying a Local Transaction Data Set


Purpose

In cases where data must be kept current and the number of updates that you need to perform is small, RLS can be used efficiently between a local and a remote host. RLS enables you to perform a local update to a remote data set.

This example creates a data set remotely by remotely submitting a DATA step. Next, it creates a local transaction data set. Using RLS, it assigns a local LIBNAME to the remote library. Finally, the program modifies the remote data set with the local transactions.


Program

   signon;
   rsubmit;
[1]    data sasuser.my_budget;
      length category $ 9;
      input category $ balance;
      format balance dollar10.2;
      datalines;
   utilities   500
   mortgage   8000
   telephone  1000
   food       3000;
   run;

   endrsubmit;

[2] data bills;
      length category $ 9;
      input category $ bill_amount;
      datalines;
   utilities    45.83
   mortgage    649.95
   food         68.21;
   run;

[3] libname rlslib slibref=sasuser 
      server=&rsession;

[4] data rlslib.my_budget;
      modify rlslib.my_budget bills;
      by category;
      balance=balance-bill_amount;
   run;

[5] data _null_;
      set rlslib.my_budget;
      put 'Balance for ' category  @25 
         'is: ' balance;
   run;

[6] signoff;
[1] Create the master data set MY_BUDGET in the library SASUSER in the remote session.
[2] Create a local or work transaction data set for updating the remote data set MY_BUDGET.
[3] Assign a local library to the library SASUSER in the remote session.
[4] Apply the transaction data set to the remote data set MY_BUDGET.
[5] Review the results. All items except TELEPHONE will be updated.
[6] Sign off from the remote host. The libref RLSLIB is deassigned as part of the sign-off processing.


Chapter Contents

Previous

Next

Top of Page

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