DATASETS Procedure

Example 7: Aging SAS Data Sets

Features:

AGE statement

This example shows how the AGE statement ages SAS files.

Program

options pagesize=40 linesize=80 nodate pageno=1 source;
LIBNAME daily 'SAS-library';
proc datasets library=daily nolist;
   age today day1-day7;
run;

Program Description

Write the programming statements to the SAS log. SAS option SOURCE writes the programming statements to the log.
options pagesize=40 linesize=80 nodate pageno=1 source;
LIBNAME daily 'SAS-library';
Specify DAILY as the procedure input library and suppress the directory listing.
proc datasets library=daily nolist;
Delete and age. Delete the last SAS file in the list, DAY7, and then age (or rename) DAY6 to DAY7, DAY5 to DAY6, and so on, until it ages TODAY to DAY1.
   age today day1-day7;
run;

SAS Log


6  options pagesize=40 linesize=80
nodate pageno=1 source;
7
8     proc datasets library=daily nolist;
9
10        age today day1-day7;
11     run;
NOTE: Deleting DAILY.DAY7 (memtype=DATA).
NOTE: Ageing the name DAILY.DAY6 to DAILY.DAY7 (memtype=DATA).
NOTE: Ageing the name DAILY.DAY5 to DAILY.DAY6 (memtype=DATA).
NOTE: Ageing the name DAILY.DAY4 to DAILY.DAY5 (memtype=DATA).
NOTE: Ageing the name DAILY.DAY3 to DAILY.DAY4 (memtype=DATA).
NOTE: Ageing the name DAILY.DAY2 to DAILY.DAY3 (memtype=DATA).
NOTE: Ageing the name DAILY.DAY1 to DAILY.DAY2 (memtype=DATA).
NOTE: Ageing the name DAILY.TODAY to DAILY.DAY1 (memtype=DATA).