|
From: Gene_Gaunt@xxxxxxxxxxxxxxx Reply-To: MI Programming on the AS400 / iSeries <mi400@xxxxxxxxxxxx> To: MI Programming on the AS400 / iSeries <mi400@xxxxxxxxxxxx> Subject: Re: [MI400] QCMDEXC errors Date: Tue, 23 Mar 2004 08:59:20 -0500
Well I think I read in other words, he complains circumlocutorily that neither QCMDEXC nor QCAPCMD log the commands they execute.
In a home-grown general purpose CL processing program, I don't recommend QCMDEXC API. It's a security hole. Use QCAPCMD API instead. This is because the QCMDEXC API does not mask DSPINPUT(*NO) parameters from the job log. The QCAPCMD API does mask DSPINPUT(*NO) parameters from the job log *if* you manage your message reference keys correrctly. You need to tell QCAPCMD API the message reference key of an *existing* message in your job log that you want to overlay with the executing command. Then QCAPCMD API will work its magic and remove DSPINPUT(*NO) parameters in that command from the job log.
Before you call QCAPCMD API, write your command as a *RQS message to the external message queue (with either SNDPGMMSG command or QMHSNDPM API) and capture the return message reference key. Then receive that message by key (with either RCVMSG command or QMHRCVPM API) but don't remove the message from the job log. Then, put that message reference key into QCAPCMD API's parameter 3, data structure CPOP0100, positions 8 to 11. For example, suppose you want to execute the following command:
CHGUSRPRF USRPRF(AAA) PASSWORD(BBB)
Notice this command has a DSPINPUT(*NO) parameter, PASSWORD. So first send/receive the command to the job log and capture the message reference key, and then pass that message reference key into QCAPCMD API. Then your job log will look like this:
CHGUSRPRF USRPRF(AAA) PASSWORD()
_______________________________________________ This is the MI Programming on the AS400 / iSeries (MI400) mailing list To post a message email: MI400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/mi400 or email: MI400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/mi400.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.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 on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.