General form, PROC CONTENTS:
PROC CONTENTS DATA=<libref.>SAS-data-set-name;
RUN;
SAS-data-set-name
specifies the data
set for which the information is listed.
|
General form, PROC DATASETS
with the CONTENTS statement:
PROC DATASETS <LIBRARY=libref> <NOLIST>;
CONTENTS
DATA=<libref.>SAS-data-set-name;
QUIT;
SAS-data-set-name
specifies the data
set for which the information is listed.
NOLIST
suppresses the printing
of the directory of SAS files in the SAS log and as ODS output.
|
proc datasets library=sasuser nolist; contents data=sale2000; quit;
proc datasets nolist; contents data=sasuser.sale2000; quit;
proc contents data=sasuser.sale2000; run;
proc contents data=work._all_; run;
proc datasets library=work nolist; contents data=_all_; quit;
Task
|
Effect
|
---|---|
Add an observation or
observations to a data set.
|
Value/identifier pairs
are added to the index or indexes.
|
Delete an observation
or observations from a data set.
|
Value/identifier pairs
are deleted from the index or indexes.
|
Update an observation
or observations in a data set.
|
Value/identifier pairs
are updated in the index or indexes.
|
Delete a data set.
|
The index file is deleted.
|
Rebuild a data set with
the DATA step.
|
The index file is deleted.
|
Sort the data in place
with the FORCE option in PROC SORT.
|
The index file is deleted.
|
General form, PROC DATASETS
with the COPY statement:
PROC DATASETS LIBRARY=old-libref <NOLIST>;
COPY
OUT=new-libref;
SELECT SAS-data-set-name;
QUIT;
old-libref
names the library from
which the data set is copied.
new-libref
names the library to
which the data set is copied.
SAS-data-set-name
names the data set
that is copied.
|
General form, PROC COPY
step:
PROC COPY OUT=new-libref IN=old-libref
<MOVE>;
SELECT SAS-data-set-name(s);
RUN;
QUIT;
old-libref
names the library from
which the data set is copied.
new-libref
names the library to
which the data set is copied.
SAS-data-set-name
names the data set
or data sets that are copied.
|
proc datasets library=sasuser nolist; copy out=work; select sale2000; quit; proc copy out=work in=sasuser; select sale2000; run;
General form, PROC DATASETS
with the CHANGE statement:
PROC DATASETS LIBRARY=libref <NOLIST>;
CHANGE old-data-set-name = new-data-set-name;
QUIT;
libref
names the SAS library
where the data set is stored.
old-data-set-name
is the current name
of the data set.
new-data-set-name
is the new name of
the data set.
|
proc copy out=work in=sasuser;
select revenue;
run;
proc datasets library=work nolist;
change revenue=income;
quit;
General form, PROC DATASETS
with the RENAME statement:
PROC DATASETS LIBRARY=libref <NOLIST>;
MODIFY SAS-data-set-name;
RENAME old-var-name-1 = new-var-name-1
<...old-var-name-n
= new-var-name-n>;
QUIT;
libref
names the SAS library
where the data set is stored.
SAS-data-set-name
is the name of the
data set that contains the variables to be renamed.
old-var-name
is the original variable
name.
new-var-name
is the new name to
be assigned to the variable.
|