Sharing Files in UNIX Environments


Sharing Files with the FILELOCKS System Option

If more than one user accesses a SAS file at the same time or if a single user has access to the same file from different SAS sessions, the results could be unpredictable. By default, the FILELOCKS system option is set to FAIL, which enables multiple SAS sessions to simultaneously read the same SAS file. (See "FILELOCKS System Option" on page 329.)

Conditions to Check When FILELOCKS=NONE

If FILELOCKS has been set to NONE, then you should do one of the following:

  • Make sure that your sasuser directory is unique for each SAS session. Typically, the system administrator assigns this directory in the system configuration file. The specification in that file or in your personal configuration file helps ensure that the directory is unique as long as you run only one SAS session at a time.

    If you run two or more SAS sessions simultaneously, you can guarantee unique user files by specifying different sasuser directories for each session. In the first session, you can use

     -sasuser ~/sasuser 

    In the n th session, you can use

     -sasuser ~/sasuser  n  

    For details, see "Order of Precedence for SAS Configuration Files" on page 17 and "SASUSER System Option" on page 361. The RSASUSER option can be used to control modifications to the Sasuser library when it is shared by several users (see "RSASUSER System Option" on page 354).

  • If you run two or more SAS sessions simultaneously (either by using the X statement or by invoking it from two different windows ) and you use the same Sasuser.Profile catalog, do not do anything within the SAS session to change that catalog (for example, using the WSAVE command or changing key assignments) because both sessions can use the same one.

  • If you and other people use the same data sets, avoid writing to them at the same time. However, multiple people can read these data sets at the same time.

Sharing Files in a Network

Introduction to Sharing Files Across Workstations

SAS can be licensed to run on one or more workstations in a network of similar machines. The license specifically lists the workstations that SAS can run on. Other workstations in the network may have access to the SAS executable files but not be able to run SAS.

If the licensed workstations are connected via NFS mounts so that they share a file system, they can all share a single copy of the SAS executables, although this is not necessary. They can also share SAS files. However, if a SAS session attempts to update a data set or catalog, it must obtain an exclusive file lock on that file to prevent other sessions from accessing that file.

If SAS is installed on workstations of different types that are connected via NFS, then each type of workstation must have its own copy of the SAS executables. For information about how to move catalogs and data sets between hosts , see "Accessing SAS Files across Compatible Machine Types in UNIX Environments" on page 108.

Accessing Files on Different Types of Workstations

If the data set or catalog you want to process exists on your network but cannot be accessed with the LIBNAME statement because it resides on a different type of workstation, you have several alternatives:

  • You can log in to the remote machine and convert the file to SAS transport format using the CPORT procedure, copy the transport file to your machine or access it via NFS, and import it using the CIMPORT procedure to your type of machine format.

  • You can FTP or RCP the file from the remote machine to your machine.

  • You can log in to the remote machine and perform the work there. This alternative works best when the file is used rarely, or if the original file changes often.

  • You can do part of your work on your machine and the other part on the remote machine. One example of this alternative would be to run a set of statements on a small test case on the local machine, and then submit the real work to be done on the remote machine. Similarly, you might want to subset a large data set on another machine, and then do local analysis on that subset. This can be accomplished with SAS/CONNECT software. For more information about Remote Library Services, SAS/CONNECT User's Guide .

Troubleshooting Accessing Data Over NFS Mounts

SAS might hang when accessing data over NFS mounts if the FILELOCKS option is set to FAIL or CONTINUE . To alleviate the problem, make sure that all NFS filelocking daemons are running on both machines (usually statd and lockd ). Your system administrator can assist with starting statd and lockd .

Note  

To test whether there is a problem with file locking, you can set the FILELOCKS system option to NONE temporarily. If setting FILELOCKS to NONE resolves the problem, then you know that there probably is a problem with the statd and lockd daemons. It is recommended that you do not set FILELOCKS to NONE permanently as it might cause data corruption or unpredictable results.




SAS 9.1 Companion for UNIX Environments
SAS 9.1 Companion For Unix Enivronments
ISBN: 1590472101
EAN: 2147483647
Year: 2004
Pages: 185
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net