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 (July 2004, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 29 Jul 2004 19:03:17 -0400
Reply-To:     Lou <lpogodajr292185@COMCAST.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Lou <lpogodajr292185@COMCAST.NET>
Subject:      Re: REMOVING COMMA AT THE END OF A VARIABLE WITH DIFFERENT LENGTH

As an alternative to reverse ordering the value and substringing and checking to make sure the last non-blank character is a comma, you could do something like:

data fee (drop = dummy); length dummy $ 200; set fie; dummy = newvar; newvar = tranwrd(dummy, ', ', ' '); run;

> From: Programmer [mailto:vimalshah007@HOTMAIL.COM] > Sent: Thursday, July 29, 2004 5:09 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: REMOVING COMMA AT THE END OF A VARIABLE WITH DIFFERENT LENGTH > > > HI > > this is what my variable looks like and I want to remove the last comma from > each observation , please help. > > Thanks > > OBS NEWVAR > > 6 1, > 76 1,4, > 98 4, > 134 1,4, > 151 1,4,6, > 154 1,4,6, > 180 1, > 219 1,4, > 224 1,4, > 233 1,4,6,7, > 236 1,4,6,7, > 238 1,4,6,7, > 240 1, > 302 1,


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