From: Sharon Keeping To: All
I want to restrict users from running queries interactively. I used the Change Command (CHGCMD) command as outlined in the Query manual. Then I wanted to grant DP personnel the authority to run queries interactively, so I created a duplicate object of the command and placed it in another library, as discussed in the book. Then the book says to place that library in front of QSYS in my *LIBL. Is there an easy way to do that? QSYS is the first lib in my system library list.
From: Ernie Malaga To: Sharon Keeping
The way to change the system portion of the library list depends on the scope you want for this change.
If you want all users to share the same system portion of the library list, change system value QSYSLIBL; the easiest way is from the WRKSYSVAL command, selecting option 2. This way you get a convenient data entry panel.
If you want some users to have a different system portion of the library list, you'll have to change their initial (sign-on) program, including one or more Change System Library List (CHGSYSLIBL) commands. The CHGSYSLIBL command changes the current job's copy of the system portion of the library list, without affecting other jobs on the system. With CHGSYSLIBL, you can add a library at the top or remove a library.
Since you want some users to run your changed command and your programmers to run the original command, you'll have to use the second method-with CHGSYSLIBL, or else all users would use the duplicate command you created.
Let's assume you've changed QSYS/RUNQRY to remove *INTERACT from the ALLOW parameter (thereby not allowing it to run interactively), and have created an ALTQSYS/RUNQRY command which does include *INTERACT, for your programmers. ALTQSYS is the name of the library where you've created the duplicate RUNQRY command.
Your regular users should not run any CHGSYSLIBL commands, in order to use the system portion of the library list as QSYSLIBL dictates-with QSYS on top. Your programmers need to run the following command in their initial program:
CHGSYSLIBL LIB(ALTQSYS) + OPTION(*ADD)
This way, ALTQSYS is placed ahead of QSYS in the system portion of the library list (for that job only). As a consequence, the duplicate command would be found (allowing *INTERACT) instead of the changed QSYS command.
By the way, I'd recommend you proceed the other way around. First create a copy in ALTQSYS, then change the ALTQSYS copy-not the original. It's always better to leave QSYS objects alone, as much as possible.
From: David Wallen To: Sharon Keeping
Do a CHGCMD to RUNQRY with ALLOW(*IPGM) but no ALLOW (*INTERACT). This allows a CL program that is run interactively to use the command but does not allow anyone to just do RUNQRY from a command line. Or, any compiled program can use the command regardless of whether it was submitted to batch or run interactively.
LATEST COMMENTS
MC Press Online