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 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 20 Jul 2006 13:41:27 -0700
Reply-To:     "Schwarz, Barry A" <>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Schwarz, Barry A" <>
Subject:      Re: counting a character in string
In-Reply-To:  <>
Content-Type: text/plain; charset="us-ascii"

string2 = compress(string1, ','); number_of_commas = length(compress(string1)) - length(compress(string2));

-----Original Message----- From: Murugappan Ramanathan [mailto:murugappan.x.ramanathan@US.HSBC.COM]

Sent: Thursday, July 20, 2006 1:04 PM To: SAS-L@LISTSERV.UGA.EDU Subject: counting a character in string

hi have a very long character string, something like this 1010, 1011, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 2010, 2011, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020

based on the number on commas in the sting i have to dynamically create an array. i want to know how can I count the number of commas in this character string. thanks for the help

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