Sign out RPG users after certain amount of time

45 pts.
Tags:
AS/400
Connection timeout
RPG Code
RPG III
RPG Screen Timeouts.

We need to sign-off our users automatically after a certain period of time.  I was wondering if anyone has the code to do this?

Since we are using JDE world, it would be nice to have RPG III, but can also call an ILE program.

Lenny



Software/Hardware used:
Timeout
ASKED: January 26, 2011  2:13 PM
UPDATED: January 31, 2011  3:24 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can set the system value QINACTITV

Discuss This Question: 12  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • AS400Lenny
    We do not want to time out everyone, only a couple of selected shipping users. I know there is a way to do this progamatically, but it has been a lot of years.
    45 pointsBadges:
    report
  • TomLiotta
    The QINACTITV system value sets the interval between inactivity tests. If QINACTITV is set for 15 minutes, for example, then the system will run a system-wide inactivity test every 15 minutes. It may be important to understand that this interval is for the whole system and not for each individual session. The QINACTMSGQ system value sets the action that the system will take when a session is determined to be inactive (i.e., when no activity occurred in the session during the previous interval). The possible actions are:
    • *ENDJOB -- a full session signoff,
    • *DSCJOB -- a disconnect, like a password-protected screen-saver, and
    • message queue -- a message is sent to the message queue named.
    Both *ENDJOB and *DSCJOB will apply to everyone. The message queue is nothing more than that -- a CPI1126 message is sent to that message queue for each inactive session, nothing is done to the session jobs. The message queue option would be what allows you to make individual decisions. You would submit a never-ending message queue monitor program that received each message and chose an action based upon user. (It might be possible to adapt a message monitor in Management Central so that it called a program, passing in details from the message. I haven't looked at how that might be done.) You might submit a job that assigns a Break Handling Exit Program (or Break-handling programs) to the named message queue (after first clearing the message queue to remove old messages). The job would then simply wait until you ended it, perhaps waiting indefinitely on the arrival of a data queue entry. The break-handler program would then run every time CPI1126 arrived on the message queue. The logic of the break-handler would be whatever you wanted it to be. Much of the code can be copy/pasted right out of the Info Center. Tom
    125,585 pointsBadges:
    report
  • AS400Lenny
    That is way more complicated than we need it to be.
    45 pointsBadges:
    report
  • TomLiotta
    That is way more complicated than we need it to be. Quite possible. Still, it's less complex than any alternatives that I know other than purchasing a product (or obtaining some free-ware solution). The restriction to some set of users is what complicates things. If those users are limited to a particular application screen, then changes can be made to the display file and the application program. The display file can signal a timeout to the application program and the program can then issue a signoff. (Change to the DSPF is mostly a recompile with new attributes specified.) But that process would apply to any user in the same screen unless the app implemented logic to discern different users. And if the user was in any other screen function that wasn't similarly changed, there would be no timeout signal sent. (System displays such as WRKSPLF would have no timeouts at all.) Tom
    125,585 pointsBadges:
    report
  • Jaymz69
    we use the QINACTITV too
    765 pointsBadges:
    report
  • Kaisersosa
    I do it this way ftsusdp4d cf e workstn f usropn f maxdev(*file) ... ... // Override waitrcd on the display file for shorter interval gCmd = 'OVRDSPF FILE(TSUSDP4D) TOFILE(*LIBL/TSUSDP4D) WAITRCD(30)'; gMsgid = utlty_RunCmd(gCmd); // With override in effect, open the display file if not %open(tsusdp4d); open tsusdp4d; endif; - - - - /free if isTimeoutUser; // Display the screen logic monitor; // Write screen, wait for input write SCREEN1; read tsusdp4d; on-error 1331; exsr @exit; endmon; else; exefmt SCREEN1; endif; Wrap the display the screen logic where - block 1 uses read/write and where - block 2 uses exefmt. At program initialization determine if the userprf is to be timed out or not timed out and condition block 1 or block 2 to display the screen accordingly. John B.
    245 pointsBadges:
    report
  • Kaisersosa
    Here's some old RPG III / IV i found that should work for this. * Screen file... farockd cf e workstn f maxdev(*file) for screen timeout c write screen1 c read arockd 9899 * This code performs auto screen/time refresh... c if *in98 = *on c exsr @exit c endif John B
    245 pointsBadges:
    report
  • AS400Lenny
    Thanks John, that was what I was after. I only need it for two programs and the few user's that use them. I appreciate all of your responses. Thank you Lenny
    45 pointsBadges:
    report
  • pdraebel
    Nice trick, sometimes we tend to look for too complicated a solution when some thinking can provide a relatively simple way to solve a problem that at first seems very complicated.
    2,380 pointsBadges:
    report
  • Splat
    Having used the QINACTMSGQ solution proposed by Tom in the past I can assure you it's not overly complicated and has the advantage of being selective in it's application.
    6,255 pointsBadges:
    report
  • AS400Lenny
    Splat, One thing you must be aware of, is that some of us work in larger IT shops and getting access to system values is nearly impossible, or takes weeks to get done because of the chain of command. One thing that must be considered is bureaucracy and working around it to achieve a goal. I am not opposed to trying new things, but I have to have the time and authority to do it. Lenny
    45 pointsBadges:
    report
  • Splat
    AS400Lenny, I realise that various shops are organised differently and developers have different resources available. I was commenting on the particular approach, not the implementation.
    6,255 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following