One of the user friendly features of SAS is that you do not need to define variables before using them in your code.
However a draw back of this is that SAS might define the variable differently than you intended if you are not careful.
For example what if had some type of DO loop that was testing your new variable.
do until(firstpart=' ');
...
firstpart=substr(original,1,position);
...
end;
Now the first place that SAS sees FIRSTPART is in the comparison to the constant string of one character length. So it will make FIRSTPART a character variable of length $1.
... View more