On Thu, 11 May 2006 02:10:41 -0700, Eash <easwara@GMAIL.COM> wrote:
>when I have variables life Live,Love,Learn - I used : Keep L:;
>But When I have Fight,Right and Tight - Is it possible to Use :ight??
>If Yes, can you Guide me? I tried :ight - and got the scary brown lines
>in the log!!
>Note : the example is just sample. In reality , I have 100+ variables
>ending with _SCORE, among 382 Variables!!! :( just want to Keep only
>the variables ending with _SCORE! :(
The LIKE operator and the use of metadata are needed to arrive at your keep
list. There are several examples in the archives, but briefly this is how
you would go about it.
data test ;
retain a_score a1_score b_score score score2 1 ;
proc sql noprint ;
select trim(name) into : keeplist separated by " "
where libname = "WORK" and
memname = "TEST" and
name like '%_SCORE';
%put <&keeplist> ;
data _score ;
set test (keep=&keeplist) ;