LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2010, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 29 Dec 2009 14:20:47 -0800
Reply-To:   Patrick <patrick.matter@GMX.CH>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Patrick <patrick.matter@GMX.CH>
Subject:   Re: Keep only variables with specific characters
Comments:   To:
Content-Type:   text/plain; charset=ISO-8859-1

Pretty much the same as Frank's version; but tested and also using the libname to filter data for &namelist;

data DATA_HAVE; c1fpop1=1; c2fpop2 =1; c3fpop3 =1; c1mpop1 =1; run;

proc sql noprint; select name into :nameList separated by ' ' from dictionary.columns where libname='WORK' and memname = 'DATA_HAVE' and upcase(name) like'%FPOP%' ; quit;

data want; set DATA_HAVE (keep=&nameList); run;

Back to: Top of message | Previous page | Main SAS-L page