Hi! I have a string made up of digits which is 18 characters long. I need to count the number of repeating digits starting from the beginning of the string. That is, given substr(myString,1,1), how many repeating characters are in the rest of the string starting at substr(myString,2,18).
Example:
'00000' should output 4 'coz there are 4 0s following the one at the beginning of the string
'100000' should output 0 'coz there are no following 1s after the first one
'1100000222' should output 1 'coz there is one following 1 after the first one
'02200000' should output 0 'coz there are no 0s following the one at the beginning of the string
'002200000' should output 1 'coz there is one 0 following the one at the beginning of the string
Can anyone help me with this? I'm in sas eg 7 12.
... View more