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 (May 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To:

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

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