Date: Tue, 6 Jan 2004 08:44:48 -0500
Reply-To: Venky Chakravarthy <venky.chakravarthy@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Venky Chakravarthy <venky.chakravarthy@PFIZER.COM>
Subject: Re: wildcard characters
On Mon, 5 Jan 2004 13:37:08 -0800, Tim Wade <wade_tj@YAHOO.COM> wrote:
>Hello-
>I know that a colon can be used as a wildcard
>character for the suffix of a variable list, e.g.,
>xbird, xdog, xcat can be referenced as "x:". Is there
>a wildcard character to abbreviate the prefix of a
>varible list, eg., dogx, catx, birdx=?????x. Thanks
>much in advance, Tim
>
>
>=====
>wade_tj@yahoo.com
>
You can use the dictionary tables in SQL where you can specify a wild card
(%) as a prefix to a constant. Too bad ... there is no direct way (to the
best of my knowledge).
data wild ;
array wild (*) catx birdx dogx tigerxz lionxy (5*1) ;
run ;
proc sql noprint ;
select name into : prefix separated by " "
from dictionary.columns
where libname = "WORK"
and memname = "WILD"
and name like "%X"
;
quit;
options nocenter ;
proc print data = wild ( keep = &prefix. ) ;
run ;
Obs CATX BIRDX DOGX
1 1 1 1
|