Example 1. RLS: Accessing Server Data to Print a List of Reports

Purpose

This code shows a client that uses RLS to access a modest amount of data on a server in order to print a list of reports. RLS is a good solution for processing a small number of observations.

Program

options sascmd="!sascmd -nosyntaxcheck";
options noxwait;1
 %let dir=c:\Public;
x mkdir &dir
libname vcl "&dir";
data vcl.request;
  report_name="January";
  copy='Y';
  output;
  report_name="February";
  copy='N';
  output;
  report_name="March";
  copy='Y';
  output;
run;   
signon rempc;
 2 libname public REMOTE 'c:\Public' server=rempc;
      data _null_;
      set public.request;
      if (copy = "Y") then do;
         put "Report " report_name 
            " has been requested";
         end;
      run;
1 Creates a data set in the user's home directory.
2 Defines a server library to a client session. The value for SERVER= is the same as the server session ID that is used in the SIGNON statement.