The first time a data set with generations in effect
is replaced, SAS keeps the replaced data set, and appends a four-character
version number to its member name, which includes # and a three-digit
number. That is, for a data set named A, the replaced data set becomes
A#001. When the data set is replaced for the second time, the replaced
data set becomes A#002. That is, A#002 is the version that is chronologically
closest to the base version. After three replacements, the result
is:
most recent (youngest)
historical version
second most recent
historical version
oldest historical version
With GENMAX=4, a fourth
replacement deletes the oldest version, which is A#001. As replacements
occur, SAS always keeps four copies. For example, after ten replacements,
the result is:
most recent (youngest)
historical version
2nd most recent historical
version
oldest historical version
The limit for version
numbers that SAS can append is #999. After 999 replacements, the youngest
version is #999. After 1,000 replacements, SAS rolls over the youngest
version number to #000. After 1,001 replacements, the youngest version
number is #001. For example, using data set A with GENNUM=4, the results
would be:
The following table shows how names are assigned to a generation group:
Naming Generation Group Data Sets
|
|
|
GENNUM= Absolute Reference
|
GENNUM= Relative Reference
|
|
|
|
|
|
|
The AIR data set is
created, and three generations are requested.
|
|
|
|
|
|
AIR is replaced. AIR
from time 1 is renamed AIR#001.
|
|
|
|
|
|
AIR is replaced. AIR
from time 2 is renamed AIR#002.
|
|
|
|
|
|
AIR is replaced. AIR
from time 3 is renamed AIR#003. AIR#001 from time 1, which is the
oldest, is deleted.
|
|
|
|
|
|
AIR is replaced, and
the number of generations is changed to two. AIR from time 4 is renamed
AIR#004. The two oldest versions are deleted.
|