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 (April 2007, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 26 Apr 2007 12:01:13 -0400
Reply-To:     sanjay sun <sanjaysum@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         sanjay sun <sanjaysum@GMAIL.COM>
Subject:      Re: A Data Manipulation Question
In-Reply-To:  <83ceb37a0704260835n2ccfe44ex183ac1d650de1ddb@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Sridhar,

I am sorry I gave you erraneous code but, I was worrying about how to avoid ',' when only one variable had a valueand others not. But not really how to get a ',' among thos values.

Thanks

Sanjay

On 4/26/07, sanjay sun <sanjaysum@gmail.com> wrote: > > Hi Group, > > I have to concatenate 3 variables and there should be a comma between the > values when more than one variabla has a value for that particular row > otherwise there shouldn't be one. > > Example (all the 3 var are character) > > A B C > > 11 22 33 > > 11 33 > > 11 22 > > 22 > > The output i want should be like the one below > > > 11, 22, 33 > 11,33 > 11,22 > 22 > > I was trying the following code but not getting quiet there. > > data x; > set x; > > length z 200; > > z= left (( put(z1,type1.)) ||' '|| put(z2,type2.)||' ' || z3 ) ; > > run; > > Can anyone help me out? > > thanks alot > > Sanjay > > >


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