Hi, I want to list out all BASE tables and indexes in a SAS library and then recreate using data set statement.
Normal data set without modify statement will wipe out the index option of the original table.
Assuming I have 30 tables in the library, how can i list out all table name and its index columns? I don't see that in dictionary table. If it is found in anywhere, i can assign it to a macro to perform the magic loop for all tables.
SASHELP.VINDEX, which is probably dictionary.index, will show which indexes are applicable to your data sets. Or the PROC DATASETS output.
What's a "magic loop"?
@WorkingMan wrote:
Hi, I want to list out all BASE tables and indexes in a SAS library and then recreate using data set statement.
Normal data set without modify statement will wipe out the index option of the original table.
Assuming I have 30 tables in the library, how can i list out all table name and its index columns? I don't see that in dictionary table. If it is found in anywhere, i can assign it to a macro to perform the magic loop for all tables.
Why recreate the tables as is? Do you intend to change anything?
Also don't forget to set the sorted by flag, if applicable, in your permanent tables.
Try this code,it could list info of WORK .Check "Use of Variable in Indexes".
data class(index=(x=(name sex)));set sashelp.class;run;
data class1;set sashelp.class;run;
proc contents data=work._all_ out=want noprint ;
run;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: