TechTalk: Changing a Command

Security - Other
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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.

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: