Previous Page | Next Page

The DATASETS Procedure

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 do the following:


Sample PROC DATASETS Output

The following DATASETS procedure includes the following:

  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 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

148  proc datasets library=health memtype=data details;

                                  Directory

    Libref         HEALTH
    Engine         V9
    Physical Name  SAS library 2
    File Name      SAS library 2

                             Member  Obs, Entries                                   File
                #  Name      Type     or Indexes   Vars  Label                      Size  Last Modified

                1  ALL       DATA         23        17                             13312  12Sep07:13:57:48
                2  BODYFAT   DATA          1         2                              5120  12Sep07:13:57:48
                3  CONFOUND  DATA          8         4                              5120  12Sep07:13:57:48
                4  CORONARY  DATA         39         4                              5120  12Sep07:13:57:48
                5  DRUG1     DATA          6         2   JAN2005 DATA               5120  12Sep07:13:57:49
                6  DRUG2     DATA         13         2   MAY2005 DATA               5120  12Sep07:13:57:49
                7  DRUG3     DATA         11         2   JUL2005 DATA               5120  12Sep07:13:57:49
                8  DRUG4     DATA          7         2   JAN2002 DATA               5120  12Sep07:13:57:49
                9  DRUG5     DATA          1         2   JUL2002 DATA               5120  12Sep07:13:57:49
               10  GROUP     DATA        148        11                             25600  12Sep07:13:57:50
               11  GRPOUT    DATA         11        40                             17408  24Mar05:15:33:31
               12  MLSCL     DATA         32         4   Multiple Sclerosis Data    5120  12Sep07:13:57:50
               13  NAMES     DATA          7         4                              5120  12Sep07:13:57:50
               14  OXYGEN    DATA         31         7                              9216  12Sep07:13:57:50
               15  PERSONL   DATA        148        11                             25600  12Sep07:13:57:51
               16  PHARM     DATA          6         3   Sugar Study                5120  12Sep07:13:57:51
               17  POINTS    DATA          6         6                              5120  12Sep07:13:57:51
               18  PRENAT    DATA        149         6                             17408  12Sep07:13:57:51
               19  RESULTS   DATA         10         5                              5120  12Sep07:13:57:52
               20  SLEEP     DATA        108         6                              9216  12Sep07:13:57:52
               21  SYNDROME  DATA         46         8                              9216  12Sep07:13:57:52
               22  TENSION   DATA          4         3                              5120  12Sep07:13:57:52
               23  TEST2     DATA         15         5                              5120  12Sep07:13:57:52
               24  TRAIN     DATA          7         2                              5120  12Sep07:13:57:53
               25  VISION    DATA         16         3                              5120  12Sep07:13:57:53
               26  WEIGHT    DATA         83        13   California Results        13312  12Sep07:13:57:53
               27  WGHT      DATA         83        13                             13312  12Sep07:13:57:53
6  !                                                  delete syndrome;    change
7    prenat=infant; run;

NOTE: Deleting HEALTH.SYNDROME (memtype=DATA).
NOTE: Changing the name HEALTH.PRENAT to HEALTH.INFANT (memtype=DATA).
7  !                     quit;

NOTE: PROCEDURE DATASETS used (Total process time):
      real time           17.10 seconds
      cpu time            0.15 seconds

Notes

Previous Page | Next Page | Top of Page