Chapter Contents

Previous

Next
SAS/CONNECT User's Guide

Considerations for Using RLS

To make the best use of RLS, careful thought must be given to the following:

Analyzing these criteria will help you determine when to use RLS and when to use data transfer or compute services. This section describes situations in which RLS may not be the ideal way to access your data and suggests alternative solutions.

Accessing data through remote library services is not efficient for large amounts of data. In this case it is usually better to use compute services to move the processing to the remote system or to use a combination of compute and data transfer services.

Similarly, RLS is not efficient for multiple passes of the data. Although the data moves from the remote machine to the local machine, the data is not written to the local disk. If the procedures that are run make multiple passes of the data, or the entire procedure must be run more than once against the data, it is better to transfer a copy of the data to the local machine. You incur the network traffic cost only one time rather than paying the cost for each pass of the data.

Data transfer services may also be a better choice when response time is delayed. This situation can occur if you are accessing remote data that is being updated simultaneously by other users. If delayed response time cannot be tolerated, consider transferring a copy of the data to the local system and removing the live data from your application.

It is very important to remember that the data you access by means of RLS must still move through the network in order to be processed by the local execution. As a result, you need to program your application to minimize the amount of data that is being requested by the local processing.

The main difference between data transfer services and RLS is that by using data transfer services, after the data has moved through the network to the local system, it is written to disk and is available for subsequent local processing.

In contrast, RLS moves data through the network to the local system where it is processed by the local execution and then discarded. Subsequent analyses of the same data would require the data to be moved through the network each time the local processing requested the data. Therefore, a client/server application should be designed to balance the costs of


Types of Data Accessible through RLS

Data that is stored in any of the following is accessible by means of RLS across all hosts:

If you attempt to access a SAS catalog when your local and remote SAS sessions run on machines that have different internal representations of data, you receive the following error message:

ERROR: You cannot open <catalog name> through 
       server <rsessid> because access to 
       catalogs is not supported when the user 
       machine and server machine have different 
       data representations.

Using a single-user server, RLS provides update access to data that is stored in external databases. The SAS/ACCESS engines, as well as the SQL engine, recognize the single-user server as one user and, therefore, enable update mode for external database sources. However, these same engines prohibit update access to external database sources when using RLS with a multi-user server. Updating is prohibited because it would be impossible for either a multi-user server or a database product to detect conflicting requests from multiple users and, therefore, impossible to guarantee data integrity and security or to provide audit trails.

You can also use RLS with SAS data views. SAS data views include SAS/ACCESS views, DATA step views, and PROC SQL views. A view is a SAS data set that describes other data. It is processed as a data set by an engine that reads the underlying data and uses the description to return the data in the requested form. This process is called view interpretation.

When the library that contains the view is accessed through a server, the view is interpreted in the server session by default. This means that the engine is loaded and called by the server to read and transform the underlying data, and a minimum amount of data is moved through the network. The local processing is unaware that a view is involved.

If the view is a PROC SQL view or if the local and remote host architectures are the same, you can cause the view to be interpreted in the local session. This is done by specifying RMTVIEW=NO in the LIBNAME statement that is used to define the remote library. If the architectures are not the same, SAS/ACCESS views and DATA step views can only be interpreted in the remote session.

SAS files of type PROGRAM cannot be accessed cross-machine. These files contain compiled DATA step code, which you cannot execute locally. The DATA step can be executed in the server's execution if it is referenced by a DATA step view that is interpreted there.

If you attempt to access a SAS utility file of either type ACCESS or PROGRAM when your local and remote SAS sessions are running on machines that have different internal representations of data, you receive the following error message:

ERROR: You cannot open <utility file name> through 
       server <rsessid>, because access to utility 
       files is not supported when the user machine 
       and server machine have different data 
       representations.


RLS Restrictions for Short Numerics and Mixed-Type Variables

SAS data sets that can be accessed by means of RLS across different host internal data representations should not include two-byte numeric variables. Due to their underlying floating-point representation scheme, most hosts on which the SAS System runs have a minimum numeric variable length of 3.

A data set that contains a two-byte variable cannot be accessed by using RLS from a three-byte host. However, this type of data set could be accessed by using the data transfer services of SAS/CONNECT. The UPLOAD and DOWNLOAD procedures can be executed so that they promote the length by one byte of any numeric variable that has a length that is less than 8 before transferring the variable to the target host. In order to promote the length of the short numerics, use the EXTENDSN=YES and V6TRANSPORT options in either the PROC UPLOAD or the PROC DOWNLOAD statement. See The UPLOAD Procedure and The DOWNLOAD Procedure for more information about these options.

With clever programming in the DATA step, it is possible to store numeric values in character variables and store character values in numeric variables. These programming techniques must not be used in any data set that is accessed by means of RLS. RLS performs character translation on character variables and numeric translation on numeric variables. As a result, the value that the programmer expected is not preserved. There are no means to detect such usage. Therefore, no message is issued.


The Implications of Data Translation for RLS

When accessing data with RLS, translation occurs on numeric variables only if the local machine and the remote machine represent floating-point numbers differently. Translation occurs on character variables only if their character representations differ. Values are translated directly from the source representation to the target representation; they do not pass through transport format.

Especially with numeric variables, translation from one representation to another may alter the value of the variable. The common type of alteration is loss of precision. This occurs when the source representation uses more bits to represent the mantissa than the target representation. There is no warning produced about loss of precision during translation.

The data transfer services of both the UPLOAD and DOWNLOAD procedures preserve precision by promoting the length by one byte of any numeric variable with a length that is less than 8 before transferring it to the target host. However, this is NOT the default action in Version 7 or Version 8. The EXTENDSN=YES and the V6TRANSPORT option must be used in order for the length to be promoted.

A rare type of value distortion is loss of magnitude. This occurs when the source representation has a greater exponent range than the target representation, and a value with a magnitude that lies in the excess range of the source representation is translated. Of course, the magnitude of this type of distortion is potentially very great, as is the percentage change. The following warning is produced when this type of alteration occurs:

WARNING:  The magnitude of at least one 
          numeric value was decreased to 
          the maximum the target 
          representation allows, due to 
          representation conversion.

Refer to the description of numeric precision in SAS Language Reference: Concepts for a detailed discussion about the numeric representation of SAS variables.


FOOTNOTE 1:  Catalog access is not supported if the local and remote platforms have different internal representations of data. [arrow]


Chapter Contents

Previous

Next

Top of Page

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