Chapter Contents

Previous

Next
SAS Companion for the OpenVMS Operating Environment

Accessing Files in Concatenated SAS Data Libraries

The SAS System uses a set of rules to determine the order in which concatenated directories are accessed. The rules differ depending on whether you are opening a SAS file for input, update, or output:


Accessing Data Sets That Have the Same Name

If you create a new SAS data set from a data set that has the same name, the DATA statement uses the output rules and the SET statement uses the input rules. In this example, the SPECIES data set originally exists only in the second directory, mydisk:[mydir].

x 'define mysearch sys$disk:[sas],mydisk:[mydir]';
libname test 'mysearch';
data test.species;
   set test.species;
   if value1='y' then
      value2=3;
run;

The DATA statement opens SPECIES for output according to the output rules, which indicate that the SAS System opens a data set in the first of the concatenated directories ( sys$disk:[sas]).

The SET statement opens the existing SPECIES data set in the second directory( mydisk:[mydir]), according to the input rules. Therefore, the original SPECIES data set is not updated. After the DATA step is processed, two SPECIES data sets exist, one in each directory.


Chapter Contents

Previous

Next

Top of Page

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