BookmarkSubscribeRSS Feed

The LIBNAME statement when given two or more locations as its library specifications has a default behavior generally described as the library specification becomes a "search path" for individual members in the concatenated library.  A LIBNAME that instead choose, when it is necessary, the youngest member of the libraries by their modified dates as its primary target file. 


(from 9.2 documentation)

Rules for Library Concatenation (For this new feature)

After you create a library concatenation, you can specify the libref in any context that accepts a simple (non-concatenated) libref. These rules determine how SAS files (that is, members of SAS libraries) are located among the concatenated libraries:

  1. When a SAS file is opened for input or update, the concatenated libraries are searched and the first the youngest occurrence of the specified file, by modified date, is used.

  2. (same)

  3. When you delete or rename a SAS file, only the first the youngest occurrence of the file is affected.
  4. Anytime a list of SAS files is displayed, only one occurrence of a filename is shown.

    Note:   Even if the name occurs multiple times in the concatenation, only the first occurrence is shown. Information pertaining to the youngest occurrence is displayed if queried.   

5 - 8. (same)


However this would be implemented; by an option to the default v9 engine or perhaps as an separate, alternate engine by itself.

Super User

Have you looked at Generation data sets?

Perhaps your actual use need might be related. Or possibly this would have a conflict with such.


Note that modification dates may not be that reliable. For example I member having a bunch of floppy disks to install SAS 6.08 and the time stamp on all of the files included 06:08 and was the same for every file on each of 40+ disks. There are system utilities to set file dates and times.

Rhodochrosite | Level 12

Its a good point, dates with questionable reliability would break this, but this case is rare and special.

Rhodochrosite | Level 12

I do have a specific use for this, but I also thought this feature might be fundamental enough on its own.  Say one has a remote library with many datasets.  The person also has certain copies of the remote library's datasets in a local, solid state, low-lag, library-cache, but a dataset on the remote side has been recently updated and is better (younger) than the cache's copy. 


There are other systems that do this for you, but if this interests anyone else, we can vote for it.

Rhodochrosite | Level 12

I think in the terms on generation datasets I'm not using the word "youngest" in the same way.  I use "youngest" as in a dataset's modified date is greater than other congruent datasets in the concatenated set of libraries.