Hi:
Look at the examples of the COMPRESS function. You can use it to compress specific characters out of a text string. For example, if you compressed all Alpha characters out of a string, what would be left would be numbers and if you compressed all numbers out of a string, what would be left would be the alpha characters. There are some good examples of the COMPRESS function in the documentation.
In addition, the SCAN function will break a text string up into "chunks", based on a delimiter. So, for example, in the text strings:
[pre]
AA123
ZZZ4567
[/pre]
it doesn't matter how "long" the alpha characters' portion is...the "dividing" line between the alpha portion and the number portion is the 1st occurence of any number. The SCAN function will break a text string into chunks, based on the delimiter and/or modifier that you specify. Again, the documentation has some good examples of using the SCAN function.
When you use either the COMPRESS or the SCAN function, your digits/numbers will still be stored in character format until you convert them to be numeric variables using the INPUT function....only then will they sort correctly ... then they are numbers.
And, to continue the "fun with functions" you might also look at the ANYDIGIT function which will tell you the starting position of any digit in a character string. So, for example, with these 2 text strings, ANYDIGIT would tell you that the '1' is in position 3 (which means that the last alpha character is in position 2) and for the second string would tell you that the '1' is in position 5 (which means that the last alpha character is in position 4).
[pre]
AA123
BBBB1234
[/pre]
cynthia