1. In this step I create a data which has only one column, column “PACKAGE” which has “SAS” written in it.
Now the question is what would be the column “PACKAGE_SUBSTR”?
PACKAGE has a length of 3.
The other variables, LETTER_1-LETTER_3, also have a length of 3. When the SUBSTR function creates a new variable, the length assigned to that variable is the same as the length of the incoming character string.
LETTER_1 , therefore, is an “S” followed by two blanks.
LETTER_1 is an “A” followed by two blanks.
LETTER_1 is an “S” followed by two blanks.
The fully concatenated string is nine characters long(without the "|" ,which are there just to show the length):
|S A S |
This entry was posted on Jul 6, 2009 at 12:20 PM and is filed under SAS, SAS-effeciency, SAS-Efficient Coding Techniques, SAS-Index, SAS-Programming, SAS-Substring. You can follow any responses to this entry through the RSS 2.0. You can leave a response.