Date: Tue, 1 Aug 2000 09:54:01 -0400
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard W. Graham" <Richard.Graham@INTELLICISIONS.COM>
Subject: Re: Combine char variables
In a data step you could do the following:
data new(drop=firstname midname lastname);
fullname = lastname||","||firstname||" "||midname;
The || is the concatenation operator;
If there are extra spaces at the end of each variable that you want to
remove, you could use the compress function as in:
fullname = compress(lastname)||","||compress(firstname)||" "||midname;
Be careful, however, because this function will remove ALL spaces within
the variable. To avoid that use the trim(left(lastname)) etc.
Richard W. Graham
Senior Consultant, Technology Delivery
Intellicisions Data Inc.
2000 Regency Parkway, Suite 355
Cary, NC 27511
(Embedded image moved to file: pic19488.gif)
<wongantonio@HON To: SAS-L@LISTSERV.UGA.EDU
GKONG.COM> cc: (bcc: Richard Graham/Tech/Intellicisions)
Sent by: "SAS(r) Subject: Combine char variables
Suppose I have 3 char variables:
I want to combine the 3 into 1 single variable
Which char function I should use ?
Thank you very much in advance.