Yes, there are 2 ways in fact - one with
proc sql;
and another using
proc datasets
.
You cannot modify an existing index, but you can delete one and add another. Here is the syntax for creating a new, simple index with both approaches:
data test(index=(c1 c2));
input c1 c2 c3 c4;
datalines;
1 3 5 2
3 5 1 7
2 6 8 9
1 2 7 3
6 1 9 1
9 1 3 6
4 1 1 7
;
run;
/* add index with proc sql; */
proc sql;
create index c3 on test(c3);
/* add index with proc datasets */
Proc Datasets library = work nolist;
modify test;
index create c4;
quit;
proc sql;
describe table test;
The describe statement 'describes' the table (including indexes) in the log, and will show:
create table WORK.TEST( bufsize=65536 )
(
c1 num,
c2 num,
c3 num,
c4 num
);
create index c4 on WORK.TEST(c4);
create index c3 on WORK.TEST(c3);
create index c1 on WORK.TEST(c1);
create index c2 on WORK.TEST(c2);
... View more