|
It's QCMDEXC not QCMDEXEC. I make that mistake a lot. There are several ways of executing a command from within RPG. All involve the use of API's. Now, many people wrap these API's with prototypes and maybe even their own subprocedures to minimize complexity of some of the more flexible of the available api's. You can search the api reference in infocenter, or the archives for the following: QCMDEXC system() QCAPCMD For true flexibility QCAPCMD wins hands down. I started out with QCMDEXC and went over to system(). After seeing how QCMDEXC can get a little more information returned on an error condition by evaluating the Program Status Data Structure I went back to QCMDEXC. I don't normally use QCAPCMD for situations where either of the other two will work. But for intense situations like prompting the user for a command, have them fill in only the parameters you want them to, and then return the command back to the rpg for further analysis or storage I'll use QCAPCMD. Like a menu system. Maybe a re-evaluation on my part is in order. Often a use of QCMDEXC gives me a generic error code in the PSDS like CPF0006-Errors occurred in command. and I have to use message handling api's to retrieve messages from the joblog to determine what the real error is. I wonder if QCAPCMD would skip that BS and give me the message I really needed in the standard api error message structure. Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com MWalter@xxxxxxxxxxxxxxx Sent by: rpg400-l-bounces@xxxxxxxxxxxx 04/07/2005 09:35 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc Subject Re: CL commands from within RPG There isn't that I'm aware of. But the API QCMDEXEC is very easy to use. Two parameters, the command and the command length. Thanks, Mark Mark D. Walter Senior Programmer/Analyst CCX, Inc. mwalter@xxxxxxxxxx http://www.ccxinc.com dpalme@xxxxxxxxxx m Sent by: To rpg400-l-bounces@ "RPG Group" <rpg400-l@xxxxxxxxxxxx> midrange.com cc Subject 04/07/2005 10:23 CL commands from within RPG AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@midrang e.com> Can someone tell me if there is a simple method of calling a CL command from within an RPG program without having to use API's? -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.