08-17-2015 12:16 PM
I'm having troubles with substr() function.
I have a data set that has a column likes this:
It is a char column and i need to remove last two "00"
But without removing the from the others.
I've tried to do this:
if substr(var1,2,2)="00" then new_var = substr(var1,1,1);
else new_var = var1;
But this didn't work.
Thanks Before anything
08-17-2015 12:28 PM
Is VAR1 numeric or character?
Are you seeing a note that numeric values were converted to character?
Your code does work if VAR1 is character and left justified in the field of 3 or more.
Need further help from the community? Please ask a new question.