• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Prevent Access to System Request Menu

    May 18, 2005 Shannon O'Donnell

    The code for this article is available for download.

    I was looking over the back issues of Four Hundred Guru recently and came across a tip by Ted Holt on preventing access to the System Request Menu. In that tip, a reader asked how to prevent his users from gaining access to the System Request Menu and inadvertently logging off the system before his cleanup code executed. Ted’s response was to monitor for the system message ID CPF1907, which is fired when the user attempts to bring up the System Request Menu. I have another solution that might appeal to you instead.

    A Bulletproof Solution

    I use the System Exit Point QIBM_QWT_SYSREQPGMS, which is the Presystem Request Program exit point. When you attach a program to this exit point, it will be called every time the user attempts to access the System Request menu, which makes it a fairly bulletproof way to ensure that you trap all access to the System Request menu without having to rely on application programs. Although the application program solution advocated by Ted is fine, when you fall back on programming to control system-type functions the potential for problems is always there. For example, you may have a program that needs to block access to the System Request menu but you may have forgotten to add that program to the user’s job, or perhaps you forgot to add the correct library to the library list so when the user attempts to call that program, they get errors. I like to use exit points whenever possible to control things like this because then OS/400 is responsible for ensuring that my user written program is called.

    The RPG IV program we will add to this exit point will automatically disallow access to the System Request menu for whatever users you specify. It does this by setting an input/output parameter to zero.

    Here’s all the code you will need for you user written exit program:

     D SysReqDsp         S                       10i 0                         
     D SysUsrDta          S                     128a                           
                                                                   
      *============================================================
     C     *Entry        Plist                                     
     C                       Parm                    SysReqDsp         
     C                       Parm                    SysUsrDta         
      *                                                            
     C                       Eval         SysReqDsp = 0                   
      *                                                            
     C                       Eval        *Inlr = *On                     
    

    That’s it. There is nothing more you need to do once you have this all set up, which is saying quite a bit considering that most exit point programs have terribly complex parameter and data structures that are hard to decipher and use.

    In the above code, the only variable you have to worry about is the SysReqDsp parameter which, as previously mentioned, be set to zero.

    Using the Exit Point Program

    To use this exit program, you will need to do two things. First, compile the above code to whatever program name you like and then attach it to the QIBM_QWT_SYSREQPGMS Exit Point using the Work With Registration Information (WRKREGINF) command.

    The second thing you’ll need to do is to call another API, QWTSETPX (Set Profile Exit Programs), which will change the user profile(s) to call your new exit program.

    You will need to explicitly set each user profile to use the new exit program because if you don’t, the user profile will not look for that exit program. Don’t ask me why this works this way. I didn’t create the exit points, I just use them.

    Killing Two Birds

    The nice thing about using the combination of the QIBM_QWT_SYSREQPGMS and the QWTSETPX API is that you can kill two birds with one stone. In this case, you can control access to not only the System Request menu but all to the users ability to call the Attention Key menu, even when it’s a user-defined custom program. This adds another layer of security to prevent your users from doing something you do not want them to do.

    To use the QWTSETPX API, you will pass to it the following data:

    Number of Entries: This is the number of Exit Program Flags (see next) you will pass for program in question.


    Exit Program Flags: This parameter controls whether or not the exit program identified in the next parameter will be called or not. The valid values are:

    • 0 — No, do not call this exit program
    • 1 — Yes, call this exit program
    • -1 — Do not change the value

    Format: This is the exit program you want the user profile to know about in the previous parameter. The valid values are:

    • ATTN0100 — This controls the Attention Program
    • SREQ0100 — This control the System Request Menu

    User ID: This is the user profile you wish to set the exit program for.

    Error Code: This is the standard API Error Data Structure.

    Once again, the RPG IV code you need to use this API is surprisingly simple. The relevant portion of that code is shown here:

    c                   callp     SetProfExt(1:1:'SREQ0100':ToUser:ErrDS) 
    c                   callp     SetProfExt(1:1:'ATTN0100':ToUser:ErrDS)
    

    Because I want to control access to both the System Request Menu and the Attention Key Menu, I call the QWTSETPX API twice, passing the appropriate Format name each time.

    Granular Control Over User Profiles

    Call this program for every user profile on you system that you do not want to allow access to the System Request Menu and/or the Attention Key menu. You could even set up a procedure whereby you call this program any time you set up or change a user profile on your system. In fact, a great way to ensure that you call this program every time is to add an exit program to the Change User Profile and Create User Profile (QIBM_QSY_CHG_PROFILE and QIBM_QSY_CRT_PROFILE) Exit Points. We will explore how to use those APIs in a future issue of Four Hundred Guru.

    RELATED ARTICLE

    Monitoring for System Request Menu Option 2

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    DRV Tech

    Get More Out of Your IBM i

    With soaring costs, operational data is more critical than ever. IBM shops need faster, easier ways to distribute IBM applications-based data to users more efficiently, no matter where they are.

    The Problem:

    For Users, IBM Data Can Be Difficult to Get To

    IBM Applications generate reports as spooled files, originally designed to be printed. Often those reports are packed together with so much data it makes them difficult to read. Add to that hardcopy is a pain to distribute. User-friendly formats like Excel and PDF are better, offering sorting, searching, and easy portability but getting IBM reports into these formats can be tricky without the right tools.

    The Solution:

    IBM i Reports can easily be converted to easy to read and share formats like Excel and PDF and Delivered by Email

    Converting IBM i, iSeries, and AS400 reports into Excel and PDF is now a lot easier with SpoolFlex software by DRV Tech.  If you or your users are still doing this manually, think how much time is wasted dragging and reformatting to make a report readable. How much time would be saved if they were automatically formatted correctly and delivered to one or multiple recipients.

    SpoolFlex converts spooled files to Excel and PDF, automatically emailing them, and saving copies to network shared folders. SpoolFlex converts complex reports to Excel, removing unwanted headers, splitting large reports out for individual recipients, and delivering to users whether they are at the office or working from home.

    Watch our 2-minute video and see DRV’s powerful SpoolFlex software can solve your file conversion challenges.

    Watch Video

    DRV Tech

    www.drvtech.com

    866.378.3366

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Expand Simplifies Network Device Management AppWorx Brings Job Scheduler to OS/400

    Leave a Reply Cancel reply

Volume 5, Number 20 -- May 18, 2005
THIS ISSUE
SPONSORED BY:

WorksRight Software
Profound Logic Software
Guild Companies

Table of Contents

  • Prevent Access to System Request Menu
  • Use SQL to Send Database Files via FTP
  • Admin Alert: Configuring an i5/OS-based EIM Table for Single Sign-On

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24
  • Big Blue Raises IBM i License Transfer Fees, Other Prices
  • Keep The IBM i Youth Movement Going With More Training, Better Tools
  • Remain Begins Migrating DevOps Tools To VS Code
  • IBM Readies LTO-10 Tape Drives And Libraries
  • IBM i PTF Guide, Volume 27, Number 23

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle