| Date: | Wed, 7 Jul 2010 17:13:34 -0400 |
| Reply-To: | msz03@albany.edu |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Mike Zdeb <msz03@ALBANY.EDU> |
| Subject: | Re: Variables ending in a string |
| Content-Type: | text/plain;charset=iso-8859-1 |
hi ... this seems to work OK ...
data x;
input x y z invcost factcost custcost wholecost;
datalines;
1 2 3 4 5 6 7
8 9 9 6 5 4 3
;
run;
proc sql noprint;
select name into :ends_with_cost separated by ' '
from dictionary.columns
where libname eq 'WORK' and memname eq 'X' and name like '%cost';
quit;
proc print data=x;
var &ends_with_cost;
run;
--
Mike Zdeb
U@Albany School of Public Health
One University Place (Room 119)
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
> is there a short hand for listing the variables:
> e.g.:
>
> var invcost factcost custcost wholecost . . . ;
>
> something like :cost?
>
> Thanks,
>
> Masoud
>
|