Initiating Generation Data Sets

Overview

To initiate generation data sets and to specify the maximum number of versions to maintain, you use the output data set option GENMAX= when creating or replacing a data set. If the data set already exists, you can use the GENMAX= option with the DATASETS procedure and the MODIFY statement.
General form, DATASETS procedure, and MODIFY statement with the GENMAX= option:
PROC DATASETS LIB=libref <NOLIST>;
MODIFY SAS-data-set (GENMAX=n);
QUIT;
Here is an explanation of the syntax:
libref
is the library that contains the data that you want to modify.
NOLIST
suppresses the directory listing.
SAS-data-set
is the name of the SAS data set that you want to modify.
n
is the number of historical versions that you want to keep, including the base version:
  • n=0, no historical versions are kept (this is the default).
  • n>0, the specified number of versions of the file that are are kept. The number includes the base version.

Example

The following DATASETS procedure modifies the data set Cargorev and requests that up to four versions be kept (one base version and three historical versions).
Note: If you choose to run this example, you must copy the data set Cargorev from the Sasuser library to the Work library.
proc datasets nolist;
   modify cargorev (genmax=4);
quit;
No message is written to the log when you specify the GENMAX= option.

Creating Generation Data Sets

Remember, new versions of a generation data set are created only when a data set is replaced, not when it is modified in place. To create new generations, use one of the following approaches:
  • a DATA step with a SET statement
  • a DATA step with a MERGE statement
  • PROC SORT without the OUT= option
  • PROC SQL with a CREATE TABLE statement
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.108.112