Currently I have the code as below to create the index. Proc sql noprint; CREATE INDEX division on sas_prompts_lib_table (division ); CREATE INDEX product_family on sas_prompts_lib_table (product_family ); CREATE INDEX upn on sas_prompts_lib_table (upn ); quit; Now I want to dynamically create the index based on the field name from below SAS macro variable. %let current_distinct_var_list = %sysfunc(prxchange(%bquote(s/\*/,/), -1, &current_typ)); Value of current_distinct_var_list can have any number of fields separated by comma. How to use this macro variable in create index for each field. May be scan function can helps but I'm not sure to implement. I was asked not create any macro for this as this solution will be added to other existing macro. On a related point, I'd like to know if we can create the index on a table (e.g., libname.test) and rename the table (e.g. libname.test_1). Does the index name get updated too?
... View more