Gutnre wrote:try this:
string newvar (a8).
compute newvar = substr(oldvar,1,7).
first, create the variable.
then, compute it and go from the first character until the seventh character.
I've tried it but an Error occured:
Error # 4309 in column 1024. Text: (End of Command)
Invalid combination of data types in an assignment. Character strings may
only be assigned to string variables. Numeric and logical quantities may
only be assigned to numeric variables. Consider using the STRING or NUMBER
Execution of this command stops.
To solve this I thought that I should have "declared" the variable @1B as string. So I wrote this:
string @1B (a8).
string @1BILiv (a8).
compute @1BILiv = substr(@1B,1,7).
But the Output reported me the error #4822 in colomn 8 which regards the fact that (rightfully) the variable @1B already exists...
How can I solve it?