Date: Wed, 1 Jun 2005 13:12:27 -0700
Reply-To: "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Subject: Re: trouble when concatenating char vars
Content-Type: text/plain; charset="US-ASCII"
Hi,
One way would be to follow your assignment
with the following two lines:
WHOLE=NORTH||","||EAST||","||SOUTH||","||WEST;
WHOLE = tranwrd(WHOLE,',,,',',');
WHOLE = tranwrd(WHOLE,',,',',');
Hope this is helpful.
Mark Terjeson
Senior Programmer Analyst, IM&R
Russell Investment Group
Russell
Global Leaders in Multi-Manager Investing
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of m k
Sent: Wednesday, June 01, 2005 1:01 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: trouble when concatenating char vars
Hi
I have four var's (NORTH, EAST, SOUTH, WEST) and I want to create var
WHOLE which shows a comma in between the four var's like below.
OBS NORTH EAST SOUTH WEST WHOLE
1 Nebraska Ohio Florida
Nebraska, Ohio, Florida
2 North Dakota New York
North Dakota, New York
3 Utah Colorado
Utah, Colorado
I tried to concatenate WHOLE=NORTH||","||EAST||","||SOUTH||","||WEST;
but it puts a comma for each missing value such that obs 3 becomes
Utah,,,Colorado
How can I proceed
Thank you
MK
---------------------------------
Yahoo! Mail
Stay connected, organized, and protected. Take the tour
|