How to retrieve the status of a user in CL ?
Last Post 27 Jan 2001 12:05 PM by Anonymous. 7 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
Anonymous
Editorial Staff Member
Editorial Staff Member
Posts:81236

--
26 Jan 2001 07:36 AM
How can you determine in a CL program if a user is currently signed on?
Anonymous
Editorial Staff Member
Editorial Staff Member
Posts:81236

--
26 Jan 2001 08:49 AM Accepted Answer
You need to use API QUSLJOB which will allow you to generate a list of all active interactive jobs for a given user into a user space. You will need to do the actual processing of the user space in another language though, eg RPG. The details of this API may be found in the Work Management APIs book. Alternatively you could do a WRKUSRJOB for the user in question to a printer file, copy that to a database file, and then process the database file, you could do that inside of a CL program, but not as good a solution as using an API.
Anonymous
Editorial Staff Member
Editorial Staff Member
Posts:81236

--
26 Jan 2001 09:03 AM Accepted Answer
Thanks for your information but due to the urgency of the program I searched a bit futher and found the following API : List signed-on users (QEZLSGNU).
Anonymous
Editorial Staff Member
Editorial Staff Member
Posts:81236

--
26 Jan 2001 09:12 AM Accepted Answer
More than one way to skin a cat as they say, both APIs will give you the info you want.
Anonymous
Editorial Staff Member
Editorial Staff Member
Posts:81236

--
26 Jan 2001 11:04 AM Accepted Answer
Alternately, you could try to get an exclusive lock in the user's message queue: RTVUSRPRF USRPRF(&USER) MSGQ(&MSGQ) MSGQLIB(&MSGQLIB)
ALCOBJ OBJ((&MSGQLIB/MSGQ *MSGQ *EXCL)) WAIT(0)
Release the lock if you get it with DLCOBJ *EXCL. Chris
Anonymous
Editorial Staff Member
Editorial Staff Member
Posts:81236

--
26 Jan 2001 03:25 PM Accepted Answer
Alternately, you could try to get an exclusive lock in the user's message queue:
RTVUSRPRF USRPRF(&USER) MSGQ(&MSGQ) MSGQLIB(&MSGQLIB)
ALCOBJ OBJ((&MSGQLIB/MSGQ *MSGQ *EXCL)) WAIT(0)
Release the lock if you get it with DLCOBJ *EXCL. Try changing the user profile DLVRY parameter to *HOLD and then try your technique. As you can see, the technique will not work, then. The system only allocates the user message queue if it is in *BREAK or *NOTIFY mode. Gary Guthrie

NEWS/400 Technical Editor
Anonymous
Editorial Staff Member
Editorial Staff Member
Posts:81236

--
26 Jan 2001 03:27 PM Accepted Answer
Alternately, you could try to get an exclusive lock in the user's message queue:

RTVUSRPRF USRPRF(&USER) MSGQ(&MSGQ) MSGQLIB(&MSGQLIB)
ALCOBJ OBJ((&MSGQLIB/MSGQ *MSGQ *EXCL)) WAIT(0)
Release the lock if you get it with DLCOBJ *EXCL. Try changing the user profile DLVRY parameter to *HOLD and then try your technique. As you can see, the technique will not work, then. The system only allocates the user message queue if it is in *BREAK or *NOTIFY mode. Gary Guthrie

NEWS/400 Technical Editor
Anonymous
Editorial Staff Member
Editorial Staff Member
Posts:81236

--
27 Jan 2001 12:05 PM Accepted Answer
Gary, Thanks for the correction. Chris
You are not authorized to post a reply.

Acceptable Use Policy