Hi Lawrence,
Thanks for your response. Indeed, when I ran the code as you said it does work but when I ran my code for some reason it does not! I am not sure why!
here is my code:
data elem;
set elem; /*briging the data set with student id's and grades */
servedgr=indexc(prgoffered,grade);
run;
here is the output I get:
SID prgoffered grade servedgr
21185582 7 2 2
21609676 78 7 1
34645086 78 8 2
35962794 7 8 2
36489197 7 8 2
36784385 78 8 2
36982055 78 8 2
37097179 78 8 2
37220566 78 8 2
37228346 7 8 2
37241067 7 8 2
37398721 7 8 2