Newsletters   Subscriptions  Forums  Store   Career  Media Kit  About Us  Contact  Search   Home 
fhg
Volume 4, Number 36 -- October 27, 2004

Monitoring for System Request Menu Option 2

Hey, Ted:


As part of our Sarbanes-Oxley compliance requirements, I have to write a CL program that temporarily changes the user's user profile. (Adopted authority is not appropriate in this case.) One concern I have is that the program may end without executing the code that undoes the temporary change. I can use a global Monitor Message (MONMSG) command to trap unexpected errors and prevent an abnormal termination, but I also need to prevent the user from canceling the program by taking option 2 of the System Request menu. Is there a way to disable that option?

--Paul


The options that are executed from the System Request menu are stored in message CPX2313 of message file QCPFMSG. There's no reason why you can't modify or override the message so that option 2 executes some command other than End Request (ENDRQS), but I don't recommend it. Let me suggest another approach.

If your program is a request-processing program, choosing option 2 from the System Request menu will cause your program to receive escape message CPF1907. By monitoring for this message, you will have complete control over the program and can handle the interruption as you please. Your request-processing program will also handle ENDRQS commands from called programs, unless they, too, are request-processing programs.

To make a program process requests, include the following commands.

sndpgmmsg msg('Request msg') topgmq(*ext) msgtype(*rqs)
rcvmsg    pgmq(*ext) msgtype(*rqs) rmv(*no)

There's nothing magical about the contents of the MSG parameter in the SNDPGMMSG command. I use something that can't be mistaken for a real command.

Put the messages at the top of the program, after the global MONMSG. In this way, you will be setting the program to trap the ENDRQS command from the start.


Here's a short program by way of example. I hope it helps.

pgm

monmsg cpf0000 exec(goto CleanUp)

sndpgmmsg msg('Rqs msg') topgmq(*ext) msgtype(*rqs) 
rcvmsg pgmq(*ext) msgtype(*rqs) rmv(*no)

call SecPgm1 
call SecPgm2

CleanUp: 
/* clean up processing goes here */
endpgm

To learn more about request-processing procedures and programs, see the CL Programming manual at IBM's iSeries Information Center.

--Ted


Click here to contact Ted Holt by e-mail.

Sponsored By
GUILD COMPANIES

Line your pockets with
iSeries knowledge!


For a limited time, you can acquire three of Brian Kelly's popular iSeries Pocket Guides as a bundle with a 20 percent discount off list price.

The bundle includes: The iSeries Pocket Database Guide, The iSeries Pocket Developers' Guide, and The iSeries Pocket Query Guide.


Buy this book bundle from
our online store today.


Technical Editors: Howard Arner, Joe Hertvik, Ted Holt,
Shannon O'Donnell, Kevin Vandever
Managing Editor: Shannon Pastore
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.


THIS ISSUE
SPONSORED BY:

WorksRight Software
Advanced Systems Concepts
Guild Companies


BACK ISSUES

TABLE OF
CONTENTS
Sending E-Mail from RPG, Take Two

Spool Control Authority Is a Security Risk

Monitoring for System Request Menu Option 2


The Four Hundred
Move iSeries Forward and Adapt, or Die, Zeitler Says

Users Express Frustration with IBM, Marketing At COMMON

Problems with Early i5 Plague Customers, Partners

Four Hundred Stuff
PFSweb Launches XML Connector for Real-Time iSeries Transactions

Bytware's StandGuard Anti-Virus Now Detects Patched OS/400 Programs

BCD Announces RPG Code Converter, Outlines Web App Enhancements

Four Hundred Monitor


Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc. (formerly Midrange Server), 50 Park Terrace East, Suite 8F, New York, NY 10034
Privacy Statement