Requests generations for a new data set, modifies
the number of generations for an existing data set, and specifies the maximum
number of versions.
Valid in: |
DATA step and PROC steps
|
Category: |
Data Set Control
|
Restriction: |
Use with output data sets only.
|
GENMAX=number-of-generations
|
-
number-of-generations
-
requests generations for a data set and
specifies the maximum number of versions to maintain. The value can be from
0 to 1000. The default is GENMAX=0, which means that no generation data sets
are requested.
You use GENMAX= to request generations
for a new data set and to modify the number of generations for an existing
data set. The first time the data set is replaced, SAS keeps the replaced
version and appends a four-character version number to its member name, which
includes # and a three-digit number. For example, for a data set named A,
a historical version would be A#001.
After generations of a data set are requested, the member
name is limited to 28 characters (rather than 32), because the last four characters
are reserved for the appended version number. When the GENMAX= data set option
is set to 0, the member name can be up to 32 characters.
If you reduce the number of generations for an existing
data set, SAS deletes the oldest versions above the new limit.
This example shows how to request generations for a
new data set. The DATA step creates a data set named WORK.A that can have
as many as 10 generations (one current version and nine historical versions):
data a(genmax=10);
x=1;
output;
run;
This example shows how to change the number
of generations on the data set MYLIB.A to 4:
proc datasets lib=mylib;
modify a(genmax=4);
run;
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.