Determining Whether a User Is Already Signed On, Take Three
June 28, 2002 Timothy Prickett Morgan
Hey, Ted:
I’d try to allocate the user’s message queue.
That would eliminate a data area in the mix.
— Tim
Several people wrote in with the same suggestion, Tim.
Most objected to creating the data area, saying it was unnecessary.
Here is the code to do it your way:
DCL VAR(&FIRSTSESSN) TYPE(*LGL) VALUE('1') DCL VAR(&MSGQ) TYPE(*CHAR) LEN(10) DCL VAR(&MSGQLIB) TYPE(*CHAR) LEN(10) RTVUSRPRF USRPRF(*CURRENT) MSGQ(&MSGQ) MSGQLIB(&MSGQLIB) ALCOBJ OBJ((&MSGQLIB/&MSGQ *MSGQ *EXCL)) WAIT(0) MONMSG MSGID(CPF1002 CPF1085) EXEC(DO) CHGVAR VAR(&FIRSTSESSN)