Hi Mike

See the R0 at the beginning? it does not look as if your script is getting the last two digits!

I just tried/debugged something similar on our systems as follows:

$SysNo = SUBSTR(@WKSTA, LEN(@WKSTA)-2,3)

IF $SysNo="152"
AT (4,4) "This is sys152" " Variable is $SysNo"
ELSE
AT (4,4) "This is NOT sys152" " Variable $SysNo"

And this works for me (we have three digits to get!)

Work on this bit in a test script and check the variable output as I did.

Good luck.
Don