USRID
The USRID function returns the User ID (logical device) number of the
job/session input device.
Syntax
USRID
Examples
10 SYSTEM "SHOWJOB" !Lists the system jobs and sessions on your terminal
20 PRINT USRID !The User ID and Logical device number of the session
21 !or job that is running this program is displayed.