midrange.com code scratchpad
Name:
Find users signed on to more than one device
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
01/30/2020 06:10:48 pm
IP:
Logged
Description:
The user was to lazy to give a description
Code:
  1. With T1 as (
  2. Select
  3. AUTHORIZATION_NAME, 
  4. CLIENT_IP_ADDRESS
  5. from table(qsys2.active_job_info(
  6. RESET_STATISTICS => 'NO',
  7. SUBSYSTEM_LIST_FILTER => 'QINTER' ,
  8. JOB_NAME_FILTER => '*ALL',
  9. CURRENT_USER_LIST_FILTER => '',
  10. DETAILED_INFO => 'ALL'
  11. )) A
  12. group by authorization_name, client_ip_address
  13. ),
  14. T2 as (
  15. Select
  16. AUTHORIZATION_NAME
  17. from t1
  18. group by authorization_name
  19. having count(*) > 1
  20. )
  21.  
  22. Select
  23. JOB_NAME,               --  The qualified job name.
  24. SUBSYSTEM,              --  The name of the subsystem where the job is running. 
  25. AUTHORIZATION_NAME, -- The user profile under which the initial thread is running at this time. For jobs that swap user profiles, this user profile name and the user profile that initiated the job can be different.
  26. CLIENT_IP_ADDRESS --  Client IP address, in IPv4 format, being used by the job. 
  27. from table(qsys2.active_job_info(
  28. RESET_STATISTICS => 'NO',
  29. SUBSYSTEM_LIST_FILTER => 'QINTER' ,
  30. JOB_NAME_FILTER => '*ALL',
  31. CURRENT_USER_LIST_FILTER => '',
  32. DETAILED_INFO => 'ALL'
  33. )) B
  34. where b.authorization_name in (
  35. select t2.authorization_name
  36. from t2)
  37. order by b.authorization_name
  38. ;
© 2004-2019 by midrange.com generated in 0.005s valid xhtml & css