Date: Thu, 20 Jul 2006 13:41:27 -0700
Reply-To: "Schwarz, Barry A" <barry.a.schwarz@BOEING.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Schwarz, Barry A" <barry.a.schwarz@BOEING.COM>
Subject: Re: counting a character in string
In-Reply-To: <200607202004.k6KIKxt9020067@mailgw.cc.uga.edu>
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
|