If I have a numeric CASEID variable with numbers like this:
What syntax can I use to remove the last two digits so it looks like:
I just want to cut all the "01" off that the end. I can find how to do this if all the cases have the same number of characters but not if they differ in number.
eg, the following syntax would work if each ID was 4 characters long, but in my case they range from 3 to 6 characters.
string newCASEID (A4).
compute newCASEID = substr(CASEID, 1, 4).
I presume it's easiest to change the numeric variable to string first,
It would be interesting to know how to do this in reverse to add a certain digit at the end but I think this is easier to find out online.
(SPSS version 23)