Is there a function to change letters with a given index in SAS?
For example, if my line is
string1 = 'abcd1234efgh'
I want to do something like:
string2 = somefunction(string1, 5, 'zzzz');
for creating
'abcdzzzzefgh'
Yes, substr() = that's what you are looking for. See here for details .
substr() =
substr(string2, 5) = 'zzzz';
The function substr(variable,position<,length>) = can also take a third argument to determine the length of the segment to replace.
substr(variable,position<,length>) =