MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » February 2014

Re: Quick question about shelling out commands from a program



fixed

On 19-Feb-2014 14:07 -0800, James H. H. Lampert wrote:
I'm working on an embedded command-line.

I've taught myself how to use QMHRTVRQ to provide an F9 key, but I
just noticed (for the first time in almost 20 years of cutting code
for AS/400s!) that when you shell out a command with QCMDEXC, it
apparently doesn't get logged for retrieval.

How do I log a shelled-out command for retrieval?


Been too long since I have written a request processing program, so I do not recall what I did to resolve the lack of the messaging in that regard. I believe perhaps, I just sent a copy to my RPP. But maybe the following might assist, even if only to get a copy of the _updated_ request message to be used by the RqsPrcPgm to send to itself?:

<http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rbam6/wrppg.htm>
IBM i 7.1 Information Center -> Programming -> Control language -> Messages -> Receiving messages into a CL procedure or program
_Writing request-processor procedures and programs_
"To become a request-processing procedure or program, your procedure or program must send and receive a request message and not remove the request message.

...

Call the QCAPCMD API and specify the message reference key to have the IBM® i command analyzer to process a request message for an IBM i command. You can get the message reference key when you receive the request message. Process Commands (QCAPCMD) will update the request message in the job log and add any new value supplied. QCAPCMD also hides any parameter values, such as passwords, that are to hidden in the job log. The system will not update the request message in the job log when one of two conditions exists.

• Using the Execute Command (QCMDEXC or QCAEXEC) APIs.
• Failing to supply a message reference key to QCAPCMD.

..."






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact