proc datasets allows to modify a data set's attribute such as variable name, format/informat and label.
However, proc dataset cannot be used to change a variable's length or data type.
List SAS files in library
proc dataset can be used to show the data sets contained in a library
libname lib_one "p:\ath\to\a\directory";
/* Create three data sets in lib_one library: */
data lib_one.dataset_a;
x = 'eggs';
run;
data lib_one.dataset_b;
y = 'why';
run;
data lib_one.dataset_c;
z = 'almost c';
run;
/* List files in library lib_one: */
proc datasets
lib=lib_one;
run;
kill deletes all datasets/members within a library.
libname tq84_lib 'p:\ath\to\some\directory';
data tq84_lib.member_one ; x=1; output; run;
data tq84_lib.member_two ; x=2; output; run;
data tq84_lib.member_three; x=3; output; run;
proc sql;
select memname
from dictionary.members
where libname = 'TQ84_LIB';
quit;
proc datasets
library=tq84_lib
kill;/* Delete all files in the library at once */
run;
proc sql;
select memname
from dictionary.members
where libname = 'TQ84_LIB';
quit;
libname tq84_ix 'p:\ath\to\some\directory';
proc datasets
library=tq84_ix
kill;
quit;
data tq84_ix.num;
length num txt $ 10;
input num txt;
datalines;
1 one
2 two
3 three
4 four
5 five
6 six
7 seven
8 eight
9 nine
10 ten
run;
proc datasets
library=tq84_ix;
modify num;
index create num / unique;
run;
proc sql;
select
name , /* Column name: num */
idxusage, /* Index type : SIMPLE */
indxname, /* Index name : num */
unique /* Unique? : yes */
from
dictionary.indexes
where
libname = 'TQ84_IX' and
memname = 'NUM';
quit;