@UserID returns the Windows NT user ID. This is not a 'calculated' value, but simply what was assigned to the domain.

If your naming convention is consistent, you could simply do the following:

$gwnaam = substr(@userid,len(@userid),1) + substr(@userid,1,len(@userid)-1)

If not, you might be able to do the following:

$ary=Split(@FULLNAME)
$gwnaam=SubStr($ary[0],1,1) + $ary[ubound($ary)]

New Mexico Mark