| RSUBSTR Function | 
replaces substrings in each entry of a given matrix
 ,
,  ,
,  ,
,  ) ;
) ;The inputs to the RSUBSTR subroutine are as follows:

is any  character matrix.
 character matrix. 

is an  matrix or a scalar that determines the starting positions for substrings to be replaced.
 matrix or a scalar that determines the starting positions for substrings to be replaced. 

is an  matrix or a scalar that determines the lengths of substrings to be replaced.
 matrix or a scalar that determines the lengths of substrings to be replaced. 

is an  matrix or a scalar that specifies the replacement strings.
 matrix or a scalar that specifies the replacement strings. 
 The RSUBSTR function returns an  matrix with substrings replaced. It replaces or substitutes substrings of the input matrix with new strings. If
 matrix with substrings replaced. It replaces or substitutes substrings of the input matrix with new strings. If  is zero, the replacement string in
 is zero, the replacement string in  is simply inserted into the input matrix
 is simply inserted into the input matrix  at the position indicated by
 at the position indicated by  .
. 
For example, the following statements replace the first two characters of each entry in the matrix X with the corresponding entry in the matrix R:
   proc iml;
      x = {abc def ghi,jkl mno pqr};
      r = {z y x, w v u};
      p = 1;
      l = 2;
      c=rsubstr(x,p,l,r);
      print x;
      print c;