Date: Wed, 2 May 2007 10:42:06 -0400
Reply-To: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Organization: Internet News Service
Subject: Re: concatenating variables with similar first letter fo
Ankur Arora wrote:
> Hi All,
>
> Does anybody have an idea about concatenating variables
> which start with same prefix.
>
> example suppose we have variable var1 var2 var3
>
> i tried using call catx(separator,variablerequired,var:)
>
> var: defines all variables starting with var get concatenates
>
> but this doesn't work.
>
> Your help is highly appreciated.
>
> Thanks
> Ankur
Use the OF <variable-list-specification> construct.
allvcatx=catx(':',of v:);
<variable-list-specification> can be any of the constructs listed in the
help (see index:[variable lists] or search for page:[SAS Variable Lists])
----------------------------------------------------
data _null_;
var1='123';
vxyz='abc';
z='ijk';
result=catx(':',z,of v:);
put result=;
a = 1;
b = 'a';
c = 2;
d = 'x';
path = catx('/',of a--d);
put path=;
run;
--
Richard A. DeVenezia
http://www.devenezia.com/