Don,
I checked with our internal expert, and here is what he came up with.
In a *standard* workspace server, this works:
%let username = %scan(%sysget(METAUSER),1,'@');
Except on z/OS, where there are no environment variables, and *pooled* workspace servers and stored process servers, which are multi-user in nature:
%let username = %scan(%sysfunc(getoption(METAUSER)),1,'@');
Note that on Windows servers, the ID you get is not domain-qualified. That is, you would see "donh", not "HCBI\donh".
Chris