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 (June 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: m k <odshtml@YAHOO.COM>
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


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