Long-running commands should not be executed interactively, but sometimes it can't be helped. For instance, the command may take much longer than you anticipated, locking your display station with input inhibited for a long time. If you need to run other commands from your display station, you may have assigned QSYS/QCMD as your Attention key handling program, so you think that all you need to do is press the Attention key. This, however, doesn't work. The Attention key is disabled during input inhibited, just like the rest of the keyboard.
The only key that remains active is SysRq (system request). You can always press SysRq, even if input is inhibited. From there, you could take option 1, but this would force you to sign on again, starting a different job. If what you need to do is check objects in QTEMP, for example, SysRq option 1 wouldn't help you at all. Besides, having to sign on is a clumsy process.
The ideal solution would be to customize the System Request menu, adding an option to call QSYS/QCMD for you. Unfortunately, IBM doesn't give us the source code, as it does for the sign-on display. However, message CPX2313 in message file QSYS/QCPFMSG contains the list of commands that the System Request menu executes when its options are selected.
The solution, then, is to change message CPX2313. As it turns out, CPX2313 contains in its first-level text all the commands for the System Request menu, one after the other, with a single blank space separating the 10-byte spaces reserved for each command, as follows:
ENDRQS DSPJOB DSPMSG (etc)
All you need to do, then, is to replace the SIGNOFF command with one of your own which would prompt for the SIGNOFF command if executed by certain people, or run a program for the rest. And that's what the SYSRQS90 command does. See Figures 6a and 6b.
SYSRQS90 first determines if the user has limited capabilities. If the answer is *YES, it prompts for the SIGNOFF command, so that System Request option 90 works as usual. If the user shows *NO or *PARTIAL for limited capabilities, however, the Command Entry panel is presented.
In order to work, the SYSQRS90 command must be placed in a library that all users have in their library lists, such as any of the libraries in the system portion of the library list.
To make this technique work, you must create the command and program included here and then run the following command:
WRKMSGD MSGID(CPX2313) + MSGF(QSYS/QCPFMSG)
When the message appears, take option 2 (Change) for message CPX2313. This will show on the screen what the message looks like now. Move the cursor to the SIGNOFF word and type SYSRQS90 over it. Don't change anything else. Then press Enter. CPX2313 is now changed. Press F3 to end WRKMSGD. From this point on, System Request option 90 will present the Command Entry panel for all users that don't have limited capabilities. And your programmers will thank you for it.
While your interactive job is showing the Command Entry panel, the other job is actually interrupted. You should refrain from running any commands that might alter the environment of the interrupted job. This includes changing the LDA, user switches, deleting or changing objects in QTEMP, and so on. Also, keep in mind that while the job is interrupted, it retains all the object locks it had while it was running; if you interrupted the job while a program had read a record for update, for example, that record will remain with an exclusive lock until the job is allowed to resume.
TechTalk: Command Entry While Input Is Inhibited
Figure 6A Command SYSRQS90
SYSRQS90: CMD PROMPT('System Request Option 90')
TechTalk: Command Entry While Input Is Inhibited
Figure 6B CL program SYSRQS90
SYSRQS90: + PGM DCL VAR(&LMTCPB) TYPE(*CHAR) LEN(10) RTVUSRPRF USRPRF(*CURRENT) LMTCPB(&LMTCPB) IF COND(&LMTCPB *EQ *YES) THEN(DO) ? SIGNOFF ENDDO ELSE CMD(DO) CALL PGM(QSYS/QCMD) ENDDO ENDPGM
LATEST COMMENTS
MC Press Online