Base SAS 9.1 Procedures Guide, Volumes 1, 2, 3 and 4

Overview: DATASETS Procedure

What Does the DATASETS Procedure Do?

The DATASETS procedure is a utility procedure that manages your SAS files. With PROC DATASETS, you can

Sample PROC DATASETS Output

The following DATASETS procedure

  1. copies all data sets from the CONTROL library to the HEALTH library

  2. lists the contents of the HEALTH library

  3. deletes the SYNDROME data set from the HEALTH library

  4. changes the name of the PRENAT data set to INFANT .

The SAS log is shown in Output 15.1.

Output 15.1: Log from PROC DATASETS

59 proc datasets library=health memtype=data details; Directory Libref HEALTH Engine V9 Physical Name external-file File Name external-file Member Obs, Entries File # Name Type or Indexes Vars Label Size Last Modified 1 ALL DATA 23 17 13312 29JAN2002:08:06:46 2 BODYFAT DATA 1 2 5120 29JAN2002:08:06:46 3 CONFOUND DATA 8 4 5120 29JAN2002:08:06:46 4 CORONARY DATA 39 4 5120 29JAN2002:08:06:46 5 DRUG1 DATA 6 2 JAN95 Data 5120 29JAN2002:08:06:46 6 DRUG2 DATA 13 2 MAY95 Data 5120 29JAN2002:08:06:46 7 DRUG3 DATA 11 2 JUL95 Data 5120 29JAN2002:08:06:46 8 DRUG4 DATA 7 2 JAN92 Data 5120 29JAN2002:08:06:46 9 DRUG5 DATA 1 2 JUL92 Data 5120 29JAN2002:08:06:46 10 GROUP DATA 148 11 25600 29JAN2002:08:06:46 11 MLSCL DATA 32 4 Multiple Sclerosis Data 5120 29JAN2002:08:06:46 12 NAMES DATA 7 4 5120 29JAN2002:08:06:46 13 OXYGEN DATA 31 7 9216 29JAN2002:08:06:46 14 PERSONL DATA 148 11 25600 29JAN2002:08:06:46 15 PHARM DATA 6 3 Sugar Study 5120 29JAN2002:08:06:46 16 POINTS DATA 6 6 5120 29JAN2002:08:06:46 17 PRENAT DATA 149 6 17408 29JAN2002:08:06:46 18 RESULTS DATA 10 5 5120 29JAN2002:08:06:46 19 SLEEP DATA 108 6 9216 29JAN2002:08:06:46 20 SYNDROME DATA 46 8 9216 29JAN2002:08:06:46 21 TENSION DATA 4 3 5120 29JAN2002:08:06:46 22 TEST2 DATA 15 5 5120 29JAN2002:08:06:46 23 TRAIN DATA 7 2 5120 29JAN2002:08:06:47 24 VISION DATA 16 3 5120 29JAN2002:08:06:47 25 WEIGHT DATA 83 13 California Results 13312 29JAN2002:08:06:47 26 WGHT DATA 83 13 California Results 13312 29JAN2002:08:06:47 60 delete syndrome; 61 change prenat=infant; 62 run; NOTE: Deleting HEALTH.SYNDROME (memtype=DATA). NOTE: Changing the name HEALTH.PRENAT to HEALTH.INFANT (memtype=DATA). 63 quit;

 

libname control ' SAS-data-library-1 '; libname health ' SAS-data-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;

Notes

Категории