The following DATASETS procedure includes the following:
-
copies all data sets from the CONTROL
library to the HEALTH library
-
lists the contents of the HEALTH
library
-
deletes the SYNDROME data set from
the HEALTH library
-
changes the name of the PRENAT
data set to INFANT
The SAS log is shown
in the following output.
LIBNAME control 'SAS-library-1';
LIBNAME health 'SAS-library-2';
proc datasets memtype=data;
copy in=control out=health;
run;
proc datasets library=health memtype=data details;
delete syndrome;
change prenat=infant;
run;
quit;
Log from PROC DATASETS
744 proc datasets library=health memtype=data details;
Directory
Libref HEALTH
Engine V9
Physical Name c:\Documents and Settings\myfile\My Documents\procdatasets\health
Filename c:\Documents and Settings\myfile\My Documents\procdatasets\health
Member Obs, Entries File
# Name Type or Indexes Vars Label Size Last Modified
1 ALL DATA 23 17 13312 12Sep07:10:57:50
2 BODYFAT DATA 83 13 California Results 13312 12Sep07:10:57:54
3 CONFOUND DATA 8 4 5120 12Sep07:10:57:50
4 CORONARY DATA 39 4 5120 12Sep07:10:57:50
5 DRUG1 DATA 6 2 JAN2005 DATA 5120 12Sep07:10:57:50
6 DRUG2 DATA 13 2 MAY2005 DATA 5120 12Sep07:10:57:50
7 DRUG3 DATA 11 2 JUL2005 DATA 5120 12Sep07:10:57:50
8 DRUG4 DATA 7 2 JAN2002 DATA 5120 12Sep07:10:57:50
9 DRUG5 DATA 1 2 JUL2002 DATA 5120 12Sep07:10:57:50
10 GROUP DATA 148 11 Test Subjects 33792 12Sep07:13:01:16
GROUP INDEX 1 9216 12Sep07:13:01:16
11 GRPOUT DATA 11 40 17408 13Dec10:11:40:24
12 GRPOUT1 DATA 11 40 17408 13Dec10:10:28:32
13 INFANT DATA 149 6 17408 12Sep07:10:57:52
14 MLSCL DATA 32 4 Multiple Sclerosis Data 5120 12Sep07:10:57:52
15 NAMES DATA 7 4 5120 12Sep07:10:57:52
16 OXYGEN DATA 31 7 17408 12Sep07:13:01:16
17 PERSONL DATA 148 11 25600 12Sep07:10:57:52
18 PHARM DATA 6 3 Sugar Study 5120 12Sep07:10:57:52
19 POINTS DATA 6 6 5120 12Sep07:10:57:52
20 RESULTS DATA 10 5 5120 12Sep07:10:57:54
21 SLEEP DATA 108 6 9216 12Sep07:10:57:54
22 TEST2 DATA 15 5 5120 12Sep07:10:57:54
23 TRAIN DATA 7 2 5120 12Sep07:10:57:54
24 VISION DATA 16 3 5120 12Sep07:10:57:54
25 WEIGHT DATA 1 2 5120 12Sep07:10:57:50
26 WGHT DATA 83 13 13312 12Sep07:10:57:54
745 delete syndrome;
746 change prenat=infant;
747 run;
ERROR: The file HEALTH.PRENAT (memtype=DATA) was not found, but appears on a CHANGE statement.
748 quit;
749
750 proc datasets memtype=data;