The GetUserState procedure returns the current number of active jobs for a given user profile.
The GetUserState procedure can be used to number of sign-on sessions (jobs) for the specific user. The return value represents both batch and interactive jobs that are currently active for the specified user.
sign-on-count GetUserState( szUserProfile 10A Const szOption 10A Const Options(*NOPASS) ) |
|
See also: CrtUsrList |
If the function succeeds, the number of current signed-on sessions (jobs) active for the user is returned.
Both batch and interactive jobs are counted. The purpose of this procedure is to check if a user profile is currently signed on. Currently there is no way to determine that only interactive jobs are checked.
The following example retrieves the count of the number of active jobs for the QPGMR user profile.
/INCLUDE QCPYSRC,utils
.....DName+++++++++++EUDSFrom+++To+++++TDc.Functions+++++++++
D nSignOnCount S 20I 0
C Eval nSignOnCount = GetUserState('QPGMR')