MODIFY statement decreases the number of versions for MyLib.Air from 4 to 0.
This decrease causes SAS to automatically delete the three historical versions:
proc datasets library=mylib;
modify air (genmax=0);
run;
Deleting Versions in a Generation Group
When you delete data sets, you can specify a specific version or an entire generation
group to delete. The following table shows the types of Delete operations and their
effects when you delete versions of a generation group.
The following examples assume that the base version of Air and two historical versions
(Air#001 and Air#002) exist for each command.
Table 26.6 Deleting Generation Data Sets
SAS Statement in PROC
DATASETS Results
delete air;
delete air(gennum=0);
Deletes the base version and shifts up historical versions.
Air#002 is renamed to Air and becomes the new base
version.
delete air(gennum=2);
Deletes historical version Air#002.
delete air(gennum=-2);
Deletes the second youngest historical version (Air#001).
delete air(gennum=all);
Deletes all data sets in the generation group, including the
base version.
delete air(gennum=hist);
Deletes all data sets in the generation group, except the
base version.
Note: Both an absolute reference and a relative reference refer to a specific version. A
relative reference does not skip deleted versions. Therefore, when you are working
with a generation group that includes one or more deleted versions, using a relative
reference results in an error if the referenced version has been deleted. For example,
if you have the base version Air and three historical versions (Air#001, Air#002, and
Air#003) and you delete Air#002, the following statements return an error, because
Air#002 does not exist. SAS does not assume that you mean Air#003:
proc print data=air (gennum= -2);
run;
Renaming Versions in a Generation Group
When you rename a data set, you can rename an entire generation group:
proc datasets;
change a=newa;
run;
You can also rename a single version by including GENNUM=:
proc datasets;
change a(gennum=2)=newa;
Understanding Generation Data Sets 625
..................Content has been hidden....................

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