I have written a subroutine (EViews 7) that uses a Shell command and a temporary table to do just that:
Code: Select all
subroutine GetCurrentUserID(string %outValue)
%value = ""
%tmpTable = "tmpUserName"
if @isobject(%tmpTable) then
delete {%tmpTable}
endif
shell(out={%tmpTable}, t=1000) whoami
%value = @upper({%tmpTable}(1,1))
if @isobject(%tmpTable) then
delete {%tmpTable}
endif
%outValue = %value
endsub
Code: Select all
%currentUserID= ""
call GetCurrentUserID(%currentUserID)
@uiprompt(%currentUserID)
