Hi, This seems like something that must have been dealt with before, but I can't find any information related with the problem. Taking the example from the SAS Language Dictionary to illustrate the use of the INDEX Function, if I run the following code, everything goes fine: the value of x is set to 10. data _null_; a='ABC.DEF (X=Y)'; b='X=Y'; x=index(a,b); put x; run; However, if I add as the very first statement a LENGTH statement for the variable b, assigning it a declared length of 4 (or higher), then running this code returns a value of 0 for x: data _null_; length b $ 4; a='ABC.DEF (X=Y)'; b='X=Y'; x=index(a,b); put x; run; Can anyone explain me why this happens, and how I can search for b in a if the declared length of b exceeds its actual length? Thanks in advance, -iwin
... View more