SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
A_SAS_Man
Pyrite | Level 9

We have a large data set that we are maintaining on a monthly basis. In order to make it more efficient for people on our team to use we are attempting to index it on a few different variables, which initially took quite a long time. I'm wondering if there is a way to update an existing index rather than re-indexing the entire data set every time we append to the data? My thinking is that if we are able to just take the new values in the set and add those to the index we could save significantly on time, but I'm not sure if the syntax exists to do that. I am creating my index with the below code.

 

 

data test2 (index=(c1
c2
c3
c4
c5
c6));
set test;
run;

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

No need to create the entire index again. Use PROC DATASETS like this

 

proc datasets lib=mylib;
   modify test2;
      index centiles c1/ refresh;
run;quit;

 

View solution in original post

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

No need to create the entire index again. Use PROC DATASETS like this

 

proc datasets lib=mylib;
   modify test2;
      index centiles c1/ refresh;
run;quit;

 

PeterClemmensen
Tourmaline | Level 20

To be clear, to update all six indexes of interest, do this.

 

proc datasets lib=mylib;
   modify test2;
      index centiles c1/ refresh;
      index centiles c2/ refresh;
      index centiles c3/ refresh;
      index centiles c4/ refresh;
      index centiles c5/ refresh;
      index centiles c6/ refresh;
run;quit;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2127 views
  • 1 like
  • 2 in conversation