GETUSER: Retrieving a User ID

How to:

Available Languages: reporting, Maintain

The GETUSER function retrieves the ID of the connected user.

Syntax: How to Retrieve a User ID

GETUSER(output)

where:

output

Alphanumeric, at least A8

Is the result field, whose length depends on the platform on which the function is issued. Provide a length as long as required for your platform; otherwise the output will be truncated.

Example: Retrieving a User ID

GETUSER retrieves the user ID of the person running the request:

DEFINE FILE EMPLOYEE
USERID/A8 WITH EMP_ID = GETUSER(USERID);
END
TABLE FILE EMPLOYEE
SUM CURR_SAL AS 'TOTAL SALARIES'
BY DEPARTMENT
HEADING
"SALARY REPORT RUN FROM USERID: <USERID"
" "
END

The output is:

SALARY REPORT RUN FROM USERID: doccar
DEPARTMENT
----------
MIS
PRODUCTION
TOTAL SALARIES
--------------
   $108,002.00 
   $114,282.00