Hi Arvind,
INDEX can only search forward -- PeterC's technique of using INDEX and REVERSE definitely works in this way. There is a new SAS 9 function, FIND, which is like INDEX but with more bells and whistles. In particular, it can search backwards.
http://support.sas.com/documentation/cdl/en/lrdict/59540/HTML/default/a002267763.htm
data _null_;
call symputx("lastu",find("&a","_",-9999));
run;
/* The -9999 is just an arbitrary number longer than
the text string. This forces a backward search. */
%let soln2=%substr(&a,1,%eval(&lastu-1));
Changed original reply - I wasn't looking carefully enough at the revised request for ex_table_case ... this should now work!
Message was edited by: RichardH
Message was edited by: RichardH